clean up some image code
parent
1d5f6901c1
commit
7d60fcc598
|
@ -5,7 +5,6 @@ images.bitmap math ;
|
|||
IN: images.backend
|
||||
|
||||
SINGLETONS: BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR ;
|
||||
! RGBA
|
||||
|
||||
TUPLE: image dim component-order bitmap ;
|
||||
|
||||
|
@ -42,9 +41,9 @@ GENERIC: normalize-scan-line-order ( image -- image )
|
|||
|
||||
M: image normalize-scan-line-order ;
|
||||
M: bitmap-image normalize-scan-line-order
|
||||
dup
|
||||
[ bitmap>> ] [ dim>> first 4 * ] bi <sliced-groups> reverse concat
|
||||
>>bitmap ;
|
||||
dup dim>> '[
|
||||
_ first 4 * <sliced-groups> reverse concat
|
||||
] change-bitmap ;
|
||||
|
||||
: normalize-image ( image -- image )
|
||||
normalize-component-order
|
||||
|
|
|
@ -25,10 +25,13 @@ M: image-gadget draw-gadget* ( gadget -- )
|
|||
: image-window ( path -- gadget )
|
||||
[ <image> <image-gadget> dup ] [ open-window ] bi ;
|
||||
|
||||
GENERIC: image. ( image -- )
|
||||
GENERIC: image. ( object -- )
|
||||
|
||||
M: string image. ( image -- ) <image> <image-gadget> gadget. ;
|
||||
: default-image. ( path -- )
|
||||
<image-gadget> gadget. ;
|
||||
|
||||
M: pathname image. ( image -- ) <image> <image-gadget> gadget. ;
|
||||
M: string image. ( image -- ) <image> default-image. ;
|
||||
|
||||
M: image image. ( image -- ) <image-gadget> gadget. ;
|
||||
M: pathname image. ( image -- ) <image> default-image. ;
|
||||
|
||||
M: image image. ( image -- ) default-image. ;
|
||||
|
|
Loading…
Reference in New Issue