Need Help Displaying a Floating-Point Image
Need Help Displaying a Floating-Point Image
- Subject: Need Help Displaying a Floating-Point Image
- From: Robert Murley <email@hidden>
- Date: Fri, 4 Aug 2006 09:52:58 -0700
I have an NSBitmapImageRep with floating-point data samples. When I
attempt to display it, I get all white. Using the same code with 8-bit
integer samples works fine. The FP samples are all between zero and
one, and the alpha channel is all ones.
Could anyone enlighten me as to what I am doing wrong?
Code to create the image rep:
NSBitmapFormat format = NSAlphaFirstBitmapFormat |
NSFloatingPointSamplesBitmapFormat;
imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: data
pixelsWide: width
pixelsHigh: height
bitsPerSample: 32
samplesPerPixel: 4
hasAlpha: YES
isPlanar: YES
colorSpaceName: NSCalibratedRGBColorSpace
bitmapFormat: format
bytesPerRow: rowBytes
bitsPerPixel: 32];
Code to display it:
IBOutlet NSImageView *imageView;
NSImage *image;
- (void) displayView: (NSBitmapImageRep *) imageRep
{
image = [[NSImage alloc] init];
[image addRepresentation: imageRep];
[imageView setImage: image];
[imageView display];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden