So I have an array (several, actually), which holds the RGB values of an image. I'm then doing some calculations with each of these arrays (let's say we're doing Red. Then Red[i][j] is the intensity of "redness" at the pixel (i,j)). Red is of type int, raster is of type uint32. My calculations depend on Red[i][j] being some nice number less than 256. When I run gdb, and tell it to print Red[7], for example, I get something along the lines of
.Code:(int*) 0xd3ff20
Can anyone tell me why it is doing this? Thanks.
Here is the relevant (hopefully) code
Code:raster = (uint32*) _TIFFmalloc(npixels * sizeof(uint32)); if (raster == NULL) printf("no memory"); TIFFReadRGBAImage(tif, w, h, raster, 0); for (i = 0; i<h; i++) { for (j = 0; j<w; j++) { z = raster[i*w + j]; Red[i][j] = (z & 0xff); Grn[i][j] = ((z>>8) & 0xff); Blu[i][j] = ((z>>16) & 0xff); } }