Re: [AD] 5.0 and 5.1 branches

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Apparently it may not even be possible without using libpng.

From: http://www.cocoabuilder.com/archive/cocoa/184516-obtaining-unpremultiplied-bitmap-from-png-file.html

"kCGImageAlphaLast is implemented and fully supported for creating a
CGImageRef. What is not implemented is creating a bitmap context (via
CGBitmapContextCreate) that does not use pre-multiplied alpha. The
distinction is subtle, but practically it means that you can create
an image that does not used pre-multiplied alpha, but in the current
API you cannot obtain the pixel data from that image into your own
buffer without getting it pre-multiplied."

--
Trent Gamblin

On 2010-11-16, at 1:49 PM, Elias Pschernig wrote:
> Hm, OSX has this:
> 
> CGContextRef context = CGBitmapContextCreate(pixels, w, h, 8, w * 4,
> colour_space, kCGImageAlphaPremultipliedLast);
> 
> I'm not sure what it means, but sounds like it also pre-multiplies?
> 
> -- 
> Elias Pschernig <elias.pschernig@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/