Code: Select all
//Create empty image
Image image1 = Image(Geometry(w,h),Color(0,0,0));//w and h contain the width and height of the image stored in chData
PixelPacket *iPtr1 = image1.setPixels(0,0,image1.columns(), image1.rows());
image1.readPixels(RGBQuantum, chData); //unsigned char *chData containing image data
image1.syncPixels();
Color clrTemp = image1.pixelColor(0,0);
Quantum tR,tG,tB;
tR = clrTemp.redQuantum();
tG = clrTemp.greenQuantum();
tB = clrTemp.blueQuantum();
Note, the data pointed to by iPtr1 contains the correct values, I just can't get these values "copied" back to the variable image1.