graphics - How can I show an image from raw pixel data in GTK using Haskell? -
i create image in haskell using rasterific library , display image in gtk window; rasterific library lets me generate rbga-formatted 32-bit pixel depth image, having trouble figuring out how can take raw image , display in window or drawarea or whatever in gtk.
(i've spent lot of time looking through documentation, i've been having hard time seeing how fit parts together, since haskell documentation non-existent , @ point cairo library gets involved in way that's not entirely clear me.)
i wrote package called ac-easyraster-gtk exact purpose.
it's wrapper around gtk2hs. library gives necessary parts, it's not easy figure out. wrote library wouldn't have keep looking stuff up!
ib_new gives new image buffer, ib_write_pixel lets write pixel, , ib_display start gtk event loop, display bitmap in window, , block calling thread until user clicks close. sadly, there's no easy way chuck entire array @ gtk. (it demands particular pixel order, varies platform...)
Comments
Post a Comment