Hello all,

I am attempting to load a 16-bit PGM (max colours 65535) using Fl_PNM_Image 
and then access the raw 16-bit values. The image file does load and does 
display. However, upon closer inspection it appears the the Fl_PNM_Image() 
is binning the 16-bit to 8-bit. The reason I say this is here:

Fl_PNM_Image.cxx:

line 174: *ptr++ = (255*val)/maxval;

For me, this is more cleanly seen as:

*ptr++ = 255*(val/maxval);


Is there a reason why the Fl_PNM_Image ctor needs to convert the 16-bit 
values to 8-bit? I understand that the underlying buffer (e.g. ptr) is uchar 
but that shouldn't make a difference as long as Fl_PNM_Image::d() returns 2?

Or is there some core need for 8-bit values...perhaps fl_draw_image()??

Cheers,

Alvin

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

Reply via email to