• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSImageRep simple code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSImageRep simple code (From: Martin Beroiz <email@hidden>)
 >Re: NSImageRep simple code (From: Graham Cox <email@hidden>)

  • Prev by Date: Sorting contents of an NSCollectionView
  • Next by Date: Core Data: UITableView moveRowAtIndexPath
  • Previous by thread: Re: NSImageRep simple code
  • Next by thread: Re: NSImageRep simple code
  • Index(es):
    • Date
    • Thread