Basically I need to put an image in a floating point format for
processing. So I use the CGImageSource facility, but a subtle
posterization effect in the shadows made me make deeper research where
it seems that the pixels get into an 8-bit pipeline in some way.
Also I saw the recent discussion about this on this list. I use
kCGImageSourceShouldAllowFloat, so the problem seems different.
In the following snippet of code, I do what I think is the simple to
test : the image color space of the bitmap context is set to the one
from the image to prevent any mapping of values. It is drawn in one
time on a big buffer. The file on input is a RAW file from a 350D (12
bits color). I've also tested with the 16-bit TIFF file coming from
the "ImproveYourImage" dmg from apple, to the same problem. The file
from apple gives 235, 235, 233. The console does not report any error.
I've also tested the following other ways :
- feeding CGImageCreate with a data provider url, which works, the
bits per component shows 32 in that case, but the final set of values
is still exactly the same.
- using the Quicktime graphic importer, but it seems to fail to handle raw files
I'm on MacOS X.4.8 PPC.
So I'm stuck, I must be missing something really obvious... but what ?
for (int i = 0 ; i < buffer.size () / 4 ; ++i)
{
float red = buffer [i * 4];
float green = buffer [i * 4 + 1];
float blue = buffer [i * 4 + 2];
red_float_set.insert (red);
green_float_set.insert (green);
blue_float_set.insert (blue);
}
// will always be less than 256
printf ("red nbr = %d\n", red_float_set.size ());
printf ("green nbr = %d\n", green_float_set.size ());
printf ("blue nbr = %d\n", blue_float_set.size ());
<<<
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden