|
|
@ -1,5 +1,5 @@ |
|
|
|
//
|
|
|
|
//
|
|
|
|
// "$Id: fl_read_image.cxx,v 1.1.2.3 2004/04/11 04:39:00 easysw Exp $"
|
|
|
|
// "$Id: fl_read_image.cxx,v 1.1.2.4 2004/04/24 04:10:24 easysw Exp $"
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// X11 image reading routines for the Fast Light Tool Kit (FLTK).
|
|
|
|
// X11 image reading routines for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -118,7 +118,7 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate |
|
|
|
memset(p, alpha, w * h * d); |
|
|
|
memset(p, alpha, w * h * d); |
|
|
|
|
|
|
|
|
|
|
|
// Check if we have colormap image...
|
|
|
|
// Check if we have colormap image...
|
|
|
|
if (image->red_mask == 0) { |
|
|
|
if (image->red_mask == 0 && image->bits_per_pixel < 24) { |
|
|
|
// Get the colormap entries for this window...
|
|
|
|
// Get the colormap entries for this window...
|
|
|
|
maxindex = fl_visual->visual->map_entries; |
|
|
|
maxindex = fl_visual->visual->map_entries; |
|
|
|
|
|
|
|
|
|
|
@ -238,6 +238,14 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// RGB(A) image, so figure out the shifts & masks...
|
|
|
|
// RGB(A) image, so figure out the shifts & masks...
|
|
|
|
|
|
|
|
if (image->red_mask == 0) { |
|
|
|
|
|
|
|
red_mask = 0xff; |
|
|
|
|
|
|
|
red_shift = 0; |
|
|
|
|
|
|
|
green_mask = 0xff00; |
|
|
|
|
|
|
|
green_shift = 8; |
|
|
|
|
|
|
|
blue_mask = 0xff0000; |
|
|
|
|
|
|
|
blue_shift = 16; |
|
|
|
|
|
|
|
} else { |
|
|
|
red_mask = image->red_mask; |
|
|
|
red_mask = image->red_mask; |
|
|
|
red_shift = 0; |
|
|
|
red_shift = 0; |
|
|
|
|
|
|
|
|
|
|
@ -261,6 +269,7 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate |
|
|
|
blue_mask >>= 1; |
|
|
|
blue_mask >>= 1; |
|
|
|
blue_shift ++; |
|
|
|
blue_shift ++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Read the pixels and output an RGB image...
|
|
|
|
// Read the pixels and output an RGB image...
|
|
|
|
for (y = 0; y < image->height; y ++) { |
|
|
|
for (y = 0; y < image->height; y ++) { |
|
|
@ -393,5 +402,5 @@ fl_read_image(uchar *p, // I - Pixel buffer or NULL to allocate |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// End of "$Id: fl_read_image.cxx,v 1.1.2.3 2004/04/11 04:39:00 easysw Exp $".
|
|
|
|
// End of "$Id: fl_read_image.cxx,v 1.1.2.4 2004/04/24 04:10:24 easysw Exp $".
|
|
|
|
//
|
|
|
|
//
|
|
|
|