• 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: Getting Data out of NSImages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Data out of NSImages


  • Subject: Re: Getting Data out of NSImages
  • From: Aaron Fothergill <email@hidden>
  • Date: Sat, 9 Oct 2004 19:12:09 +0100

So I could create a new NSBitmapImageRep, init it with initWithBitmapDataPlanes to the right size and then add it to my NSImage to be drawn into. Sounds like a plan :)

Aaron
_____________________________
Aaron Fothergill : MD / Lead Coder
Strange Flavour Ltd
email@hidden
http://www.strangeflavour.com
On 9 Oct 2004, at 18:57, 陳銘崧 a.k.a. James Chen wrote:

Hi,
You could get NSBitmapImagRep from NSImage and then access the pixels via -bitmapData.
Getting NSBitmapImagRep from NSImage, you have iterate -representations of NSImage and check its class which is -kindOf:[NSBitmapImagRep class] one by one.
Note that the order of components are ARGB in meshed (non-planar) format.
HTH,
James

------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
On Oct 10, 2004, at 1:32 AM, Aaron Fothergill wrote:

further to this post. I've just found out that the TIFFRepresentation *does* save out alpha, but Photoshop loads it in differently from the way it does with TGAs, ie it pulls it as a layer and doesn't show a separate Alpha channel :)

Ideally I'd still like to be able to get at the pixel data though if anyone knows how.

Aaron
_____________________________
Aaron Fothergill : MD / Lead Coder
Strange Flavour Ltd
email@hidden
http://www.strangeflavour.com
On 9 Oct 2004, at 17:59, Aaron Fothergill wrote:

While I can save the TIFFRepresentation of an NSImage, it doesn't contain any alpha information (and doing a setAlpha on the default NSImageRep doesn't force it to either ;) ). How do I access the data in an NSImage to save out the information I need, namely 32 bit RGBA info ?

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Getting Data out of NSImages (From: Aaron Fothergill <email@hidden>)
 >Re: Getting Data out of NSImages (From: Aaron Fothergill <email@hidden>)
 >Re: Getting Data out of NSImages (From: 陳銘崧 a.k.a. James Chen <email@hidden>)

  • Prev by Date: Re: multiple documents, single window
  • Next by Date: How to correctly control cursor???
  • Previous by thread: Re: Getting Data out of NSImages
  • Next by thread: How to correctly control cursor???
  • Index(es):
    • Date
    • Thread