! 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 ; IN: images.memory ! Some code shared by core-graphics and cairo for constructing ! images from off-screen graphics contexts. There is probably ! no reason to call it directly. byte-array ; : ( alien dim -- image ) [ bitmap-data ] keep swap >>dim swap >>bitmap ; PRIVATE> : make-memory-bitmap ( dim quot -- image ) '[ [ malloc-bitmap-data ] keep _ [ ] 2bi ] with-destructors ; inline