mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
* 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.
This commit is contained in:
parent
35fe6ec4cf
commit
a9c3c22c33
12 changed files with 150 additions and 18 deletions
|
@ -542,9 +542,15 @@ imageop_rgb2rgb8(self, args)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue