|
![](/i/fill.gif) |
Warp wrote:
> Le Forgeron <jgr### [at] free fr> wrote:
>> PS: printf usually as an issue with double precision, do not expect
>> all the digits!
>
> printf has no issues with double precision. It's just a question of
> specifying the proper parameters.
>
> double d = 1.234567890123456789;
> printf("%.15f\n", d);
>
> prints:
>
> 1.234567890123457
>
> And by the way, color values are calculated using single precision
> floating points in povray.
I would probably just write the binary to a file, rather than use printf.
So in theory I can patch the source code to output these 32-bit floats for
each colour for each pixel rendered?
I found the following code in pvbmp.cpp:
for (i = 0 ; i < width ; i++)
{
out << (unsigned char) floor (line_data [i] [pBLUE] * 255.0) ;
out << (unsigned char) floor (line_data [i] [pGREEN] * 255.0) ;
out << (unsigned char) floor (line_data [i] [pRED] * 255.0) ;
}
So this line_data[i][pBLUE] is a single float value that I can just write
directly to a file rather than using *255.0 and floor()...
Post a reply to this message
|
![](/i/fill.gif) |