Re: NSImageRep simple code
Re: NSImageRep simple code
- Subject: Re: NSImageRep simple code
- From: Graham Cox <email@hidden>
- Date: Thu, 4 Mar 2010 16:02:07 +1100
On 04/03/2010, at 3:54 PM, Martin Beroiz wrote:
> bitsPerSample:8
> pixels[0] = 1;
> pixels[1] = 0;
> pixels[2] = 0;
> pixels[3] = 0;
> The docs say that NSDeviceWhiteColorSpace has pure white at 1.0, so I'm guessing that pixels[0] = 1 will set a white pixel, am I wrong?
Yes. Because you're setting the pixel buffer values directly, you need to set the 8 bits you asked for. So value 0 is one end, value 255 is the other. Pixels are not expressed directly as values in a colour space.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden