RGB Triplets
Posted: 2010-02-25T01:17:22-07:00
Hey All,
I have an image in memory and I want to create a RGB triplet (RGBRGBRGBRGB etc) buffer in memory.
I have the following code:
The values I am being returned are >255 which I thought that given the image is 8bpp, 255 would be the maximum value I could receive?
I have 2 questions:
1) Is there an easy way to get a RGB triplet buffer that represents the image?
2) If not, why are the values I am getting so large? Am I geting the data correctly?
Thanks heaps for your help,
Steve Q.
I have an image in memory and I want to create a RGB triplet (RGBRGBRGBRGB etc) buffer in memory.
I have the following code:
Code: Select all
Color clr;
img.depth( 8 );
clr = img.pixelColor( 100, 100 );
unsigned short red = clr.redQuantum();
unsigned short green = clr.greenQuantum();
unsigned short blue = clr.blueQuantum();
I have 2 questions:
1) Is there an easy way to get a RGB triplet buffer that represents the image?
2) If not, why are the values I am getting so large? Am I geting the data correctly?
Thanks heaps for your help,
Steve Q.