Pixel Components in NSBitmapImageRep
Pixel Components in NSBitmapImageRep
- Subject: Pixel Components in NSBitmapImageRep
- From: Fred Glover <email@hidden>
- Date: Mon, 12 Jul 2004 21:33:12 -0700
The problem domain is image processing and analysis. I need to know the
order of the pixel components in an NSBitmapImageRep handed me from
NSImageView.
From the super class NSImageRep I can get the size, bitsPerSample,
colorSpaceName, hasAlpha, isOpaque, pixelsHigh and pixelsWide.
From NSBitMapImageRep itself I can get bitsPerPixel, bytesPerPlane,
bytesPerRow, isPlanar, numberOfPlanes and samplesPerPixel, as well as
the raw bitmapData.
So I can find if the ImageRep has Alpha and even if it is RGB, RGBA,
grayscaleAlpha or grayscale only.
All very nice but this isn't the complete picture.
Image bitmaps with Alpha can have the alpha byte first or last and the
RGB bytes premultiplied or not. This is all setup by the programmer
when using CGBitmapContextCreate.
I can use CGBitmapContextGetAlphaInfo to get the alpha info from the
current graphics context but that doesn't apply to the ImageRep.
Why can't I get the similar value from NSBitmapImageRep?
How can I tell what the byte order is in the bitmapData?
Obviously if I created the NSBitmapImageRep for myself, I would know,
but this is an ImageRep being handed to me from NSImageView via drag
and drop or opened from a file.
I've been right through the latest Quartz 2D documents and jcr's
Monochrome Image and Image Difference examples including speeding up
Monochrome Image 25X.
Am I missing a piece of the puzzle in how NSImage "manages" its own
image representations for the desired display device?
Fred Glover
Machine Vision and Image Processing Engineering
Visicon Inc
www.visiconeng.com
Los Gatos, CA
408 354-0095
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.