For my iPhone 3D apps I am currently using CoreGraphics to load png files that have pre-multiplied alpha. Here are the essentials:
// load a 4-channel rgba png file with pre-multiplied alpha.
CGContextRef context =
CGBitmapContextCreate(data, width, height, 8, num_channels * width, colorSpace,
kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
// Draw the image into the context
CGRect rect = CGRectMake(0, 0, width, height);
CGContextDrawImage(context, rect, image);
CGContextRelease(context);
I then go on and use the data as a texture in OpenGL.
My question: By specifying pre-multiplied alpha - kCGImageAlphaPremultipliedLast - am I - inadvertently - telling CoreGraphics to multiply the r g b channels by alpha or - what I have assumed - am I merely indicating that the format of the incoming image has pre-multiplied alpha?
Thanks, Doug