1 module libwasm.bindings.ImageBitmap;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.Blob;
7 import libwasm.bindings.CanvasRenderingContext2D;
8 import libwasm.bindings.ImageData;
9 
10 @safe:
11 nothrow:
12 
13 struct ChannelPixelLayout {
14   nothrow:
15   JsHandle handle;
16   alias handle this;
17   this(Handle h) {
18     this.handle = JsHandle(h);
19   }
20   static auto create() {
21     return ChannelPixelLayout(libwasm_add__object());
22   }
23   void offset()(uint offset) {
24     Object_Call_uint__void(this.handle, "offset", offset);
25   }
26   uint offset()() {
27     return Object_Getter__uint(this.handle, "offset");
28   }
29   void width()(uint width) {
30     Object_Call_uint__void(this.handle, "width", width);
31   }
32   uint width()() {
33     return Object_Getter__uint(this.handle, "width");
34   }
35   void height()(uint height) {
36     Object_Call_uint__void(this.handle, "height", height);
37   }
38   uint height()() {
39     return Object_Getter__uint(this.handle, "height");
40   }
41   void dataType()(ChannelPixelLayoutDataType dataType) {
42     Object_Call_int__void(this.handle, "dataType", dataType);
43   }
44   ChannelPixelLayoutDataType dataType()() {
45     return Object_Getter__int(this.handle, "dataType");
46   }
47   void stride()(uint stride) {
48     Object_Call_uint__void(this.handle, "stride", stride);
49   }
50   uint stride()() {
51     return Object_Getter__uint(this.handle, "stride");
52   }
53   void skip()(uint skip) {
54     Object_Call_uint__void(this.handle, "skip", skip);
55   }
56   uint skip()() {
57     return Object_Getter__uint(this.handle, "skip");
58   }
59 }
60 enum ChannelPixelLayoutDataType {
61   uint8,
62   int8,
63   uint16,
64   int16,
65   uint32,
66   int32,
67   float32,
68   float64
69 }
70 struct ImageBitmap {
71   nothrow:
72   JsHandle handle;
73   alias handle this;
74   this(Handle h) {
75     this.handle = JsHandle(h);
76   }
77   uint width()() {
78     return Object_Getter__uint(this.handle, "width");
79   }
80   uint height()() {
81     return Object_Getter__uint(this.handle, "height");
82   }
83   void close()() {
84     Object_Call__void(this.handle, "close");
85   }
86 }
87 enum ImageBitmapFormat {
88   RGBA32,
89   BGRA32,
90   RGB24,
91   BGR24,
92   GRAY8,
93   YUV444P,
94   YUV422P,
95   YUV420P,
96   YUV420SP_NV12,
97   YUV420SP_NV21,
98   HSV,
99   Lab,
100   DEPTH
101 }
102 alias ImageBitmapSource = SumType!(CanvasImageSource, Blob, CanvasRenderingContext2D, ImageData);
103 alias ImagePixelLayout = Sequence!(ChannelPixelLayout);
104 
105