* Extended X interface: pixmap objects, colormap objects visual objects,
image objects, and lots of new methods.
* Added counting of allocations and deallocations of builtin types if
COUNT_ALLOCS is defined. Had to move calls to NEWREF down in some
files.
* Bug fix in sorting lists.
diff --git a/Modules/imageop.c b/Modules/imageop.c
index 40940cb..841ec1b 100644
--- a/Modules/imageop.c
+++ b/Modules/imageop.c
@@ -542,9 +542,15 @@
for ( i=0; i < nlen; i++ ) {
/* Bits in source: aaaaaaaa BBbbbbbb GGGggggg RRRrrrrr */
value = *cp++;
+#if 0
r = (value >> 5) & 7;
g = (value >> 13) & 7;
b = (value >> 22) & 3;
+#else
+ r = (int) ((value & 0xff) / 255. * 7. + .5);
+ g = (int) (((value >> 8) & 0xff) / 255. * 7. + .5);
+ b = (int) (((value >> 16) & 0xff) / 255. * 3. + .5);
+#endif
nvalue = (r<<5) | (b<<3) | g;
*ncp++ = nvalue;
}