• 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: Copying raw RGBA image data to NSBitmapImageRep coming
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying raw RGBA image data to NSBitmapImageRep coming


  • Subject: Re: Copying raw RGBA image data to NSBitmapImageRep coming
  • From: Heinrich Giesen <email@hidden>
  • Date: Thu, 11 Jan 2007 12:23:04 +0100


On 11.01.2007, at 02:00, E. Wing wrote:

So I was using GL_UNSIGNED_BYTE because I thought it would always be
in big endian (endian-independent) format. Does NSBitmapImageRep not
want this, but a platform native endian order?

Bytes are endian-independent and NSBitmapImageRep wants the color components
almost always (as default RGBA case) first the red, then the green then the blue
color component. So your decision to use GL_UNSIGNED_BYTE was absolutly
correct. It is platform independent.


About the alpha channel you wrote:

But this did get me thinking about trying just RGB instead of RGBA.
Using the following code instead:
... code deleted ...
This fixed all my funny color problems. But now I'm really curious,
what is it about the alpha and my settings that was causing the
problem? (And what is the fix so I can use alpha?)

My guess is that your data are not premultiplied but NSBitmapImageRep
assumes premultiplied data, i.e. no color component must have a value
greater than alpha. Otherwise this could lead to "over-saturated" images.
Changing "bitmapFormat:0" into:
"bitmapFormat: NSAlphaNonpremultipliedBitmapFormat" could do it.


Good luck
	Heinrich

--
Heinrich Giesen
email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: Annoying 'parse error before' messages
  • Next by Date: Is it a iCal Bug?
  • Previous by thread: Re: [workaround/giving up] NSMutableArray of strings bound to NSTokenField does not update after paste
  • Next by thread: Is it a iCal Bug?
  • Index(es):
    • Date
    • Thread