• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CGImage vs NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Fetch request problem with core data relationship and NSTableView
  • Next by Date: RE: Fetch request problem with core data relationship and NSTableView
  • Previous by thread: Re: Fetch request problem with core data relationship and NSTableView
  • Next by thread: HUD text edit app?
  • Index(es):
    • Date
    • Thread