! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types destructors fry images kernel
-libc math sequences ;
+USING: accessors alien.c-types alien.data destructors images
+kernel libc math sequences ;
IN: images.memory
! Some code shared by core-graphics and cairo for constructing
<PRIVATE
-: bitmap-size ( dim -- n ) product "uint" heap-size * ;
+: bitmap-size ( dim -- n ) product uint heap-size * ;
: malloc-bitmap-data ( dim -- alien ) bitmap-size 1 calloc &free ;
[ bitmap-data ] keep
<image>
swap >>dim
- swap >>bitmap
- little-endian? ARGB BGRA ? >>component-order ;
+ swap >>bitmap ;
PRIVATE>
: make-memory-bitmap ( dim quot -- image )
'[
[ malloc-bitmap-data ] keep _ [ <bitmap-image> ] 2bi
- ] with-destructors ; inline
\ No newline at end of file
+ ] with-destructors ; inline