Re: 32bit float array to PNG thanks to NSBitmapImageRep problem
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