<< FIX: Problem finding WX (widgets) dependency running Steam ContentPrep.app while performing OSX Builds | Home | HOWTO: Force software OpenGL renderering for an OSX OpenGL Application >>

Quick Tip: Working with CGBitmapContext and pixel ordering (RGBA, BGRA etc)

This isn't immediately obvious from the Apple documentation. Hopefully this is more clear.

If you are working with RGBA images you use kCGBitmapByteOrder32Big combined with kCGImageAlphaLast or kCGImageAlphaPremultipliedLast or kCGImageAlphaNoneSkipLast.

If you are working with BGRA images you use kCGBitmapByteOrder32Little combined with kCGImageAlphaFirst or kCGImageAlphaPremultipliedFirst or kCGImageAlphaNoneSkipFirst.