Author: matt
Date: 2007-12-20 08:32:56 -0800 (Thu, 20 Dec 2007)
New Revision: 6006
Log:
Fixed 16 bit PNM image support (STR #1847)
Modified:
branches/branch-1.1/CHANGES
branches/branch-1.1/src/Fl_PNM_Image.cxx
Modified: branches/branch-1.1/CHANGES
===================================================================
--- branches/branch-1.1/CHANGES 2007-12-20 16:22:53 UTC (rev 6005)
+++ branches/branch-1.1/CHANGES 2007-12-20 16:32:56 UTC (rev 6006)
@@ -5,6 +5,7 @@
STR #1639, STR #1645, STR #1644, STR #1792, STR #1793,
STR #1742, STR #1777, STR #1794, STR #1827, STR #1843,
STR #1796)
+ - Fixed 16 bit PNM image support (STR #1847)
- Fixed exposure event on zero size windows (STR #1824)
- Fixed overlay offset for OS X Quartz (STR #1729)
- gl_font() support for Xft+X11 (STR #1809)
Modified: branches/branch-1.1/src/Fl_PNM_Image.cxx
===================================================================
--- branches/branch-1.1/src/Fl_PNM_Image.cxx 2007-12-20 16:22:53 UTC (rev
6005)
+++ branches/branch-1.1/src/Fl_PNM_Image.cxx 2007-12-20 16:32:56 UTC (rev
6006)
@@ -155,21 +155,29 @@
}
}
break;
-
+
case 5 :
case 6 :
+ if (maxval < 256) {
fread(ptr, w(), d(), fp);
- break;
-
+ } else {
+ for (x = d() * w(); x > 0; x --) {
+ val = (uchar)getc(fp);
+ val = (val<<8)|(uchar)getc(fp);
+ *ptr++ = (255*val)/maxval;
+ }
+ }
+ break;
+
case 7 : /* XV 3:3:2 thumbnail format */
- for (x = w(); x > 0; x --) {
- byte = (uchar)getc(fp);
-
- *ptr++ = (uchar)(255 * ((byte >> 5) & 7) / 7);
- *ptr++ = (uchar)(255 * ((byte >> 2) & 7) / 7);
- *ptr++ = (uchar)(255 * (byte & 3) / 3);
- }
- break;
+ for (x = w(); x > 0; x --) {
+ byte = (uchar)getc(fp);
+
+ *ptr++ = (uchar)(255 * ((byte >> 5) & 7) / 7);
+ *ptr++ = (uchar)(255 * ((byte >> 2) & 7) / 7);
+ *ptr++ = (uchar)(255 * (byte & 3) / 3);
+ }
+ break;
}
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit