USING: images tools.test kernel accessors ;
IN: images.tests
-[ B{ 57 57 57 255 } ] [ 1 1 T{ image f { 2 3 } RGBA ubyte-components f B{
+[ B{ 57 57 57 255 } ] [ 1 1 T{ image f { 2 3 } RGBA ubyte-components f f B{
0 0 0 0
0 0 0 0
0 0 0 0
57 57 57 255
0 0 0 0
0 0 0 0
-} ] [ B{ 57 57 57 255 } 1 1 T{ image f { 2 3 } RGBA ubyte-components f B{
+} ] [ B{ 57 57 57 255 } 1 1 T{ image f { 2 3 } RGBA ubyte-components f f B{
0 0 0 0
0 0 0 0
0 0 0 0
[
{
{
- T{ image f { 2 2 } L ubyte-components f B{ 1 2 5 6 } }
- T{ image f { 2 2 } L ubyte-components f B{ 3 4 7 8 } }
+ T{ image f { 2 2 } L ubyte-components f f B{ 1 2 5 6 } }
+ T{ image f { 2 2 } L ubyte-components f f B{ 3 4 7 8 } }
}
{
- T{ image f { 2 2 } L ubyte-components f B{ 9 10 13 14 } }
- T{ image f { 2 2 } L ubyte-components f B{ 11 12 15 16 } }
+ T{ image f { 2 2 } L ubyte-components f f B{ 9 10 13 14 } }
+ T{ image f { 2 2 } L ubyte-components f f B{ 11 12 15 16 } }
}
}
] [
[
{
{
- T{ image f { 2 2 } L ubyte-components f B{ 1 2 4 5 } }
- T{ image f { 1 2 } L ubyte-components f B{ 3 6 } }
+ T{ image f { 2 2 } L ubyte-components f f B{ 1 2 4 5 } }
+ T{ image f { 1 2 } L ubyte-components f f B{ 3 6 } }
}
{
- T{ image f { 2 1 } L ubyte-components f B{ 7 8 } }
- T{ image f { 1 1 } L ubyte-components f B{ 9 } }
+ T{ image f { 2 1 } L ubyte-components f f B{ 7 8 } }
+ T{ image f { 1 1 } L ubyte-components f f B{ 9 } }
}
}
] [
index-buffer index-count vertex-format texture bump ka ;
: white-image ( -- image )
- { 1 1 } BGR ubyte-components f
- B{ 255 255 255 } image boa ;
+ <image>
+ { 1 1 } >>dim
+ BGR >>component-order
+ ubyte-components >>component-type
+ B{ 255 255 255 } >>bitmap ;
: up-image ( -- image )
- { 1 1 } BGR ubyte-components f
- B{ 0 0 0 } image boa ;
+ <image>
+ { 1 1 } >>dim
+ BGR >>component-order
+ ubyte-components >>component-type
+ B{ 0 0 0 } >>bitmap ;
: make-texture ( pathname alt -- texture )
swap [ nip load-image ] [ ] if*