Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSBitmapImageRep and modifying pixel values



Hey there,

I'm currently working on creating an application that uses bump mapping and
I ran into a small issue with image storing and manipulation that I was
hoping someone could help me out with.

I am currently using NSBitmapImageRep to store the image data in my program,
but I recently read that NSBitmapImageRep pre-multiplies the data if there
is an alpha component in the image. (That is it multiplies the source bitmap
RGB pixels by the alpha value before it stores the image in
NSBitmapImageRep).

In my bump map algorithm, I am modifying the RGB values of the bitmap using
glPixelTransfer() by a set value before they are stored and I was wondering
if the pre-multiplication step that is done by NSBitmapImageRep could cause
any unwanted effects for me.

I was also reading that if you want to be able to modify the bitmap pixel
values then NSBitmapImageRep is not the way to go (because of the
pre-multiplication, this was in the apple documentation on
NSBitmapImageRep), and that the Quartz function CGImageCreate should be used
along with kCGImageAlphaLast.

So I'm not sure if I should continue using NSBitmapImageRep, or if I should
look into using a different format to store the images.

If anyone has any thoughts, comments, or information on this, let me know :)
Thanks
Danielle

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.