• 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
Need Help Displaying a Floating-Point Image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Need Help Displaying a Floating-Point Image
      • From: "Michael Ash" <email@hidden>
  • Prev by Date: Re: resolving aliases
  • Next by Date: Re: Unlocalises displayName for NSFont?
  • Previous by thread: Re: File changed notification
  • Next by thread: Re: Need Help Displaying a Floating-Point Image
  • Index(es):
    • Date
    • Thread