import { Canvas } from '../../Canvas';
export * from './Rect';
export * from './Path';
export * from './Circle';
export * from './RoundedRect';
export * from './Line';
export * from './Points';
export * from './Oval';
export * from './Atlas';
export function vec(x, y) {
    return { x, y };
}
export function rect(x, y, width, height) {
    return { x, y, width, height };
}
export function drawAsImage(elements, size = { width: 300, height: 150 }) {
    const canvas = Canvas.createCustomView();
    if (size.width !== 300 && size.height !== 150) {
        canvas._isBatch = true;
        canvas.width = size.width;
        canvas.height = size.height;
        canvas._isBatch = false;
        canvas._layoutNative();
    }
    for (const element of elements) {
        element._addCanvas(canvas);
        element.draw();
    }
    // const asset = new ImageAsset() as any;
    const snapshot = canvas.snapshot();
    // if (global.isAndroid) {
    // 	const value = new java.lang.Long(asset.native.__addr);
    // 	console.log(value);
    // 	(org as any).nativescript.canvas.NSCImageAsset.loadImageFromBitmap(new java.lang.Long(asset.native.__addr), snapshot.android);
    // }
    return snapshot;
}
//# sourceMappingURL=index.js.map