-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathImages.wlt
56 lines (52 loc) · 1.31 KB
/
Images.wlt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Needs["MUnit`"]
Test[
LibraryFunctionLoad[
"liblibrary_tests",
"test_image_arg",
{LibraryDataType[Image, "Bit"]},
NumericArray
][
Image[{{0, 1}, {1, 0}}, "Bit"]
]
,
NumericArray[{0, 1, 1, 0}, "Integer8"]
]
Test[
LibraryFunctionLoad["liblibrary_tests", "test_create_bitmap_image", {}, Image][]
,
Image[{{0, 1}, {1, 0}}, "Bit"]
]
Test[
LibraryFunctionLoad["liblibrary_tests", "test_create_color_rgb_u8_image", {}, Image][]
,
Image[
NumericArray[
{
{{255, 0 }, { 0, 200}}, (* Red channel*)
{{0, 255}, { 0, 200}}, (* Green channel *)
{{0, 0}, {255, 200}} (* Blue channel *)
},
"UnsignedInteger8"
],
"Byte",
ColorSpace -> "RGB",
Interleaving -> False
]
]
Test[
LibraryFunctionLoad["liblibrary_tests", "test_create_color_rgb_f32_image", {}, Image][]
,
Image[
NumericArray[
{
{{1.0, 0.0}, {0.0, 0.8}}, (* Red channel*)
{{0.0, 1.0}, {0.0, 0.8}}, (* Green channel *)
{{0.0, 0.0}, {1.0, 0.8}} (* Blue channel *)
},
"Real32"
],
"Real32",
ColorSpace -> "RGB",
Interleaving -> False
]
]