29 |
* All rights reserved. |
* All rights reserved. |
30 |
*. |
*. |
31 |
* |
* |
32 |
* Image display. |
* Image display. |
33 |
* |
* |
34 |
*/ |
*/ |
35 |
|
|
723 |
max_col = FL_min(256, (1 << im->depth)); |
max_col = FL_min(256, (1 << im->depth)); |
724 |
if (!xcolor) |
if (!xcolor) |
725 |
xcolor = fl_malloc(256 * sizeof(*xcolor)); |
xcolor = fl_malloc(256 * sizeof(*xcolor)); |
726 |
/* |
/* |
727 |
* not theoretically correct as colormap may have changed |
* not theoretically correct as colormap may have changed |
728 |
* since the last time we asked for colors. Take a chance for |
* since the last time we asked for colors. Take a chance for |
729 |
* performace. |
* performace. |
730 |
*/ |
*/ |
731 |
if (lastcolormap != im->xcolormap) |
if (lastcolormap != im->xcolormap) |
732 |
{ |
{ |
816 |
fl_rgbmask_to_shifts(rgb2p->rmask, &rgb2p->rshift, &rgb2p->rbits); |
fl_rgbmask_to_shifts(rgb2p->rmask, &rgb2p->rshift, &rgb2p->rbits); |
817 |
fl_rgbmask_to_shifts(rgb2p->gmask, &rgb2p->gshift, &rgb2p->gbits); |
fl_rgbmask_to_shifts(rgb2p->gmask, &rgb2p->gshift, &rgb2p->gbits); |
818 |
fl_rgbmask_to_shifts(rgb2p->bmask, &rgb2p->bshift, &rgb2p->bbits); |
fl_rgbmask_to_shifts(rgb2p->bmask, &rgb2p->bshift, &rgb2p->bbits); |
819 |
} |
} |
820 |
|
|
821 |
#define Compatible(x,im) \ |
#define Compatible(x,im) \ |
822 |
(x.depth==im->depth && \ |
(x.depth==im->depth && \ |
1122 |
im->red_lut, im->green_lut, im->blue_lut, |
im->red_lut, im->green_lut, im->blue_lut, |
1123 |
im->map_len, &empty_slots); |
im->map_len, &empty_slots); |
1124 |
|
|
1125 |
/* It's better to take a chance of finding similar colors in the |
/* It's better to take a chance of finding similar colors in the |
1126 |
colormap than reducing the number of colors too much */ |
colormap than reducing the number of colors too much */ |
1127 |
done = (empty_slots == im->map_len) || |
done = (empty_slots == im->map_len) || |
1128 |
(empty_slots < 12 || empty_slots < maxcol / 4); |
(empty_slots < 12 || empty_slots < maxcol / 4); |
1381 |
unsigned int ww, hh, bjunk, djunk; |
unsigned int ww, hh, bjunk, djunk; |
1382 |
int xx, yy; |
int xx, yy; |
1383 |
Window root; |
Window root; |
1384 |
XGetGeometry(im->xdisplay, pixmap, &root, &xx, &yy, &ww, &hh, |
XGetGeometry(im->xdisplay, pixmap, &root, &xx, &yy, &ww, &hh, |
1385 |
&bjunk, &djunk); |
&bjunk, &djunk); |
1386 |
w = ww; |
w = ww; |
1387 |
h = hh; |
h = hh; |