• 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
Re: 32bit float array to PNG thanks to NSBitmapImageRep problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 32bit float array to PNG thanks to NSBitmapImageRep problem


  • Subject: Re: 32bit float array to PNG thanks to NSBitmapImageRep problem
  • From: Greg Guerin <email@hidden>
  • Date: Tue, 8 Jun 2010 09:40:46 -0700

Pierre-Yves Aquilanti wrote:

NSData * binaryData=[NSData dataWithContentsOfFile:binaryPath]; // binary is
just a 32bits array full of 1500. and 3000. as described previously


Does the endian-ness of the floats in the file match the endian-ness of the processor the code is running on?

Also, in the NSCalibratedWhiteColorSpace, white is 1.0, black is 0.0, and grays all lie in the normalized range 0.0 thru 1.0. So 1500 and 3000 are "whiter than white" and will undoubtedly be truncated to white (1.0).

It's unclear to me what the "white" value is in your 1500 and 3000 values, but if 3000 is white, then you need to divide your raw data by 3000 to get it into normalized range.

  -- GG

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: QuickTime web browser plugin - get current timecode
  • Next by Date: Re: [iPhone] Preprocessing events sent to UITableView
  • Previous by thread: 32bit float array to PNG thanks to NSBitmapImageRep problem
  • Next by thread: Garbage collector
  • Index(es):
    • Date
    • Thread