This is a short routine that *should* dump the pixel values of the image in
the window iff_window. It works fine for a 16-color image. But when it
reads a 32-color image, it does fine for colors 0-15, but thinks colors
16-31 are 0-15 again. What am I doing wrong here?
Thanks for your help!
void PixelDump (iff_x, iff_y) /* Tells it the width & height of the window
*/
int iff_x, iff_y;
{
int i, j;
long int color;
for (j=0;j<iff_y;j++){
for (i=0;i<iff_x;i++) {
color = ReadPixel(iff_window->RPort,i,j);
printf ("Color is %ld\n", color); }
Hmmn… With what you've shown us, I'm not certain what the problem is.
It sounds as if your window might be opened on only a 16 color screen, so
you'd lose one bitplane of the information, but I'd assume you would
notice that…
–>Steve Bennett
The problem turned out to be an insuffecient number of bitplanes picked in
PLANEPICK in the image structure. Thanks to Vic Wagner for hunting it down
for me!
Loyd