Hi,
I would like to know how can i get information from a CGImageRef image to put them into initWithBitmapDataPlanes like bitsPerSample, hasAlpha, bitsPerPixel etc... ?
Thank you!
I would like to know how can i get information from a CGImageRef image to put them into initWithBitmapDataPlanes like bitsPerSample, hasAlpha, bitsPerPixel etc... ?
Thank you!
PHP:
NSImage *imagePath = [[NSImage alloc] initWithContentsOfFile:@"/Users/bker/Desktop/TEST/001.jpg"];
//NSImage *imagePath = [[NSImage alloc] initWithContentsOfFile:@"/Users/bker/Desktop/TEST/001.png"];
//NSImage *imagePath = [[NSImage alloc] initWithContentsOfFile:@"/Users/bker/Desktop/TEST/001.tiff"];
CGImageSourceRef asource = CGImageSourceCreateWithData((CFDataRef)[imagePath TIFFRepresentation], NULL);
CGImageRef bitmap = CGImageSourceCreateImageAtIndex(asource, 0, NULL);
NSBitmapImageRep *bitmap = [NSBitmapImageRep alloc];
[bitmap initWithBitmapDataPlanes:NULL
pixelsWide: ?
pixelsHigh: ?
bitsPerSample: ?
samplesPerPixel: ?
hasAlpha: ?
isPlanar: ?
colorSpaceName: ?
bitmapFormat: ?
bytesPerRow: ?
bitsPerPixel: ?
];