Re: NSImageRep simple code
Re: NSImageRep simple code
- Subject: Re: NSImageRep simple code
- From: Martin Beroiz <email@hidden>
- Date: Wed, 3 Mar 2010 23:14:55 -0600
Oh, thanks! I was missing that, now it works ok. I'll keep playing with this toy code.
M.
On Mar 3, 2010, at 11:02 PM, Graham Cox wrote:
>
> 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