CIImage. , CoreImage RGB, , HSV.
, , . , , UIColor RGB , HSV , , , UIColor RGB .
CGImageRef imageRef = [img CGImage];
uint width = CGImageGetWidth(imageRef);
uint height = CGImageGetHeight(imageRef);
unsigned char *pixels = malloc(height*width*4);
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(pixels, width, height, 8, 4*width, colorSpaceRef, kCGImageAlphaPremultipliedLast);
CGColorSpaceRelease(colorSpaceRef);
CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef);
for (int y=0;y<height;++y){
for (int x=0;x<width;++x){
int idx = (width*y+x)*4;
}
}
imageRef = CGBitmapContextCreateImage(context);
CGContextRelease(context);
free(pixels);
UIImage* newImg = [UIImage imageWithCGImage:imageRef];
: , . bjorndagerman @github
, RGB -> HSV -> RGB, , , , , HSV CoreImage.
: @dfd, , , , , Google, RGB HSV .