Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Displaying an image with floating point samples



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.