CGImage vs NSImage
CGImage vs NSImage
- Subject: CGImage vs NSImage
- From: "Barry" <email@hidden>
- Date: Fri, 15 Jun 2007 13:08:26 +0100
I'm writing an app which needs to read an image, convert pixel data to L*a*b
(if not already in this colorspace), do some maths on this data & write a
set of grayscales.
Since I'm very new to cocoa I've trawled the 'net looking for samples.
First ImageApp looked promising - it read & displayed almost every image I
could find (Tiff, JPG, sRGB,WideGamut, L*a*b). It used CGImage's but I could
not get hold of the RAW (original file) data. I tried creating a Lab
colorspace with CGColorSpaceCreateLab and then a CGBitmapContext. Then
CGContextDrawImage & CGBitmapContextGetData but a deadend awaited - cannot
do this with Lab !
Back to another sample app. Thuis time it uses NSImage's
This has the advantage that I can get the bitmapdata from the
NSBitmapImageRep.
Sadly the app does not open images containing L*a*b colorspace data.
I tried to step through to find out why, but could not see the link between
[[NSDocumentController sharedDocumentController]
openDocumentWithContentsOfFile:filename display:YES]
and
loadDataRepresentation:(NSData*)data ofType:(NSString*)aType
Spent ages in Interface Builder looking at Connections. Found one called
openDocument linking File->Open to FirstResponder.
But then the FirstResponder Class has no such methods. . .
lost . .
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden