 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types kernel accessors grouping sequences
 combinators math byte-arrays fry images half-floats
-specialized-arrays ;
+specialized-arrays words ;
 FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: uint
 SPECIALIZED-ARRAY: ushort


! TODO RGBX, XRGB, BGRX, XBGR conversions

! BGR>
: BGR>RGB ( bitmap -- bitmap' )
    3 <sliced-groups> [ <reversed> ] map concat ; inline


: BGRA>ARGB ( bitmap -- bitmap' )
    4 <sliced-groups> [ <reversed> ] map concat ; inline

: RGB>RGB ( bitmap -- bitmap' ) ;

: RGB>BGR ( bitmap -- bitmap' ) BGR>RGB ; inline

: RGB>RGBA ( bitmap -- bitmap' ) add-dummy-alpha ; inline
