• 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
alpha value from NSBitmapImageRep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

alpha value from NSBitmapImageRep


  • Subject: alpha value from NSBitmapImageRep
  • From: chaitanya pandit <email@hidden>
  • Date: Tue, 28 Oct 2008 15:29:43 +0530

I want to compute the alpha value of each pixel of an image.
What i am doing right now is i create a NSBitmapImageRep from the image and use colorAtX: y: to get the alpha value form the color at that pixel.
So i need to do this for each and every pixel in the image.
I was just going through the WWDC 2008's "916-Getting started with Instruments" session where they worked on a sample image enhancement app.
They had a similar case where they had to compute the color at every pixel.


The author says the process can be optimized if we first gather the imageRep's data and then access the color values directly from that data

So heres how i get the data:
unsigned char *data = [mImageRep bitmapData] , *pixel;


Now how do i access the pixel information from over here? any idea?
I'd be glad if someone can help me optimize this.

_______________________________________________

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


  • Follow-Ups:
    • Re: alpha value from NSBitmapImageRep
      • From: Graham Cox <email@hidden>
    • Re: alpha value from NSBitmapImageRep
      • From: "Ken Ferry" <email@hidden>
  • Prev by Date: Code signing validation
  • Next by Date: Re: alpha value from NSBitmapImageRep
  • Previous by thread: Re: Code signing validation
  • Next by thread: Re: alpha value from NSBitmapImageRep
  • Index(es):
    • Date
    • Thread