I probably shouldn't bother you folks with this, but... it was a bit of mystery how to convert my old Fl_RGB_Image based graphics routines to FLTK2, so your forebearance is appreciated.

Some stuff to play with zlib and loading and saving image data directly to and from fltk2 Images.  This may help demystify some of the inner workings of the new rgbImage classes.  Did you wonder where the "array" went?  Well, it's not there... in fact it doesn't seem to be anywhere until you use the class function "buffer()", and LO!  There it is.

Anyway, this is just a demo that loads image data from memory, decompresses it, displays it and then compresses the image that is displayed, saves it to disk as hex bytes that are identical to the hex that creates the image in the first place.

The raw image (RGBA pixel type) is about 31 K in the Image and about 1.2 K compressed.  Almost a 30 to 1 compression ratio, zero-loss.





Attachment: zlib-images.tar.gz
Description: GNU Zip compressed data

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to