Color space conversion of pixel data

I need to do some low level custom pixel image processing in CIE XYZ, CIE L* a* b* and CIE LCh.


What API should I use to convert raw pixel data between color spaces (eg device, sRGB, linear RGB and the ones mentioned above)?


I'm Interested in knowing more about the options available for both macOS and iOS, both fast (perhaps less accurate) and accurate (perhaps slower) methods.


This is something that every major graphics app does but I haven't been able to find any definite / obvious solutions.


(I have tried several different options, including rolling my own from scratch, but this seems like a prime example of something that shouldn't be necessary to reinvent.)

What Apple API? I would have thought Core Graphics is the lowest level you can get e.g.

CGColorSpaceRef
Some examples of people using it for pixel manipulation in this thread: http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

Higher up you have NSColor / NSColorSpace that can convert between colour spaces too but will assume you know this.
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/DrawColor/Tasks/UsingColorSpaces.html
Color space conversion of pixel data
 
 
Q