Displaying an image with floating point samples
Displaying an image with floating point samples
- Subject: Displaying an image with floating point samples
- From: Robert Murley <email@hidden>
- Date: Thu, 27 Jul 2006 11:04:08 -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. Could anyone enlighten me as to what I am
doing wrong?
Code to create the image rep:
NSBitmapFormat format = NSAlphaFirstBitmapFormat |
NSFloatingPointSamplesBitmapFormat;
bitsPerSample = 32;
imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: data
pixelsWide: width
pixelsHigh: height
bitsPerSample: bitsPerSample
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