POV-Ray : Newsgroups : povray.general : Outputing floating point or 32-bits per color frame data Server Time
2 Aug 2024 20:15:10 EDT (-0400)
  Outputing floating point or 32-bits per color frame data (Message 10 to 19 of 19)  
<<< Previous 9 Messages Goto Initial 10 Messages
From: Rafal 'Raf256' Maj
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 24 Aug 2004 18:08:44
Message: <Xns95501D926980raf256com@203.29.75.35>
war### [at] tagpovrayorg news:412b8fb2@news.povray.org

>   The IEEE 32-bit floating point format is very well specified and
> there should not be problems in making any program to read that (even
> if the target architecture does not support IEEE floats, it should not
> be a problem to convert from the IEEE format to whatever format the
> architecture in question uses).
>   32 bits per color component makes the (uncompressed) image file 4 times
> bigger than a regular full-color image file, but that's not unacceptable.

Btw, how about in addition a text file? Like:

width_pixels height_pixels
maximum_value_of_RGB_component
pixel_y0_x0 pixel_y0_x1 pixel_y0_x2 pixel_y0_x3
pixel_y1_x0 pixel_y1_x1 pixel_y1_x2 pixel_y1_x3

and each pixel is:red green blue where each R,G,B is either a float or a 
integer ranged from 0 .. maximum_value_of_RGB_component (usualy 0 - 255 or 
0.0 - 1.0)

So for example:

640 480
1.0
1.0 0.0 0.0 0.5 0.5 0.0 (...)
0.9987 0.0 0.0 0.499 0.499 0.0 (...)

is an 640x480 image with red pixel, then yellow, in first line, etc.

As addition to IEEE floats format - it would be very easy to read form user 
program and still it will have very heavy quality

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 24 Aug 2004 18:13:04
Message: <Xns95502958884Braf256com@203.29.75.35>
chr### [at] gmxde news:412ba2ed@news.povray.org

> If you have a portable code for reading and writing 32-bit IEEE floating 
> point numbers i would be happy to see.

how about:

http://charm.cs.uiuc.edu/doxygen/charm/pup__xlater_8C-source.html

and http://www.math.byu.edu/~schow/work/IEEEFloatingPoint.htm

and others from:

http://www.google.pl/search?q=IEEE+%2232%22+bit+float++C+source

http://www.google.pl/search?q=IEEE+%2232%22+bit+float++C+source
http://www.google.pl/search?q=IEEE+%2232%22+bit+float++C+source

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Christoph Hormann
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 25 Aug 2004 03:54:24
Message: <412c45b0$1@news.povray.org>
Warp wrote:
> 
>>If you have a portable code for reading and writing 32-bit IEEE floating 
>>point numbers i would be happy to see.
> 
> 
>   You mean there are formats which are impossible to read and interpret
> correctly with C++? I find that hard to believe.
> 

I never said anything like that, i just said if you have code for this i 
would like to see it.

-- 
Christoph Hormann
http://www.tu-bs.de/~y0013390/


Post a reply to this message

From: Warp
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 25 Aug 2004 04:00:53
Message: <412c4735@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> I never said anything like that, i just said if you have code for this i 
> would like to see it.

  Well, that *sounds* like you were saying "I don't believe it's possible
to write such a code".

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Warp
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 25 Aug 2004 04:03:10
Message: <412c47be@news.povray.org>
Rafal 'Raf256' Maj <spa### [at] raf256com> wrote:
> Btw, how about in addition a text file? Like:

  The original concern was that an ascii file would take too much space.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Christoph Hormann
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 25 Aug 2004 05:09:29
Message: <412c5749$1@news.povray.org>
Warp wrote:
> 
>>I never said anything like that, i just said if you have code for this i 
>>would like to see it.
> 
> 
>   Well, that *sounds* like you were saying "I don't believe it's possible
> to write such a code".
> 

I just mean i would like to see such a code because it is not straight 
away for me to write, especially not efficiently.

-- 
Christoph Hormann
http://www.tu-bs.de/~y0013390/


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 25 Aug 2004 07:22:21
Message: <Xns95508862CD246raf256com@203.29.75.35>
war### [at] tagpovrayorg news:412c47be@news.povray.org

>   The original concern was that an ascii file would take too much space.

But there could be two * two versions of such output,
1) text integer (default: max = 255)
2) text float (default: max = 1.000 precision=6.6 scientific_notation=1)
3) binary integer (default: max = 255 round_to_bytes=1)
4) binary IEEE float (default: max = 1.000)

in 2) precision and scientific notation define output text format 
precission.

In 3) round to bytes defines what to do with max=30000. 
It must be rounded to next 2^n power, to 32768- so 15 bits per color 
component. But it also could be rounded to next 2^(n*8) power so each color 
component would be aligned to a char/byte.

I think I can write such patch. Perhaps someone will help me to connect it 
to povcode - add parsing of tokens of command line for defining output and 
connecting it to file output module.


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Warp
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 25 Aug 2004 11:07:50
Message: <412cab46@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> I just mean i would like to see such a code because it is not straight 
> away for me to write, especially not efficiently.

  I haven't seen any, sorry... :)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Fredrik Eriksson
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 25 Aug 2004 13:46:59
Message: <opsdaud7fhcs6ysw@news.povray.org>
On Wed, 25 Aug 2004 11:09:28 +0200, Christoph Hormann  
<chr### [at] gmxde> wrote:
> I just mean i would like to see such a code because it is not straight  
> away for me to write, especially not efficiently.


In response to this, I have written just such code. It took hours to get  
everything right, but it seems to work now.

It needs to be tested thoroughly, and I want to make it a little more  
endianness-friendly, but I should have something to show you soon.

I don't know how it ranks regarding efficiency though; I've been more  
concerned with correctness.



-- 
FE


Post a reply to this message

From: Fredrik Eriksson
Subject: Re: Outputing floating point or 32-bits per color frame data
Date: 25 Aug 2004 16:49:40
Message: <opsda2uocvcs6ysw@news.povray.org>
Real-world concerns demanded my attention for a few hours, but now I'm  
back.

Feel free to look at the code, and don't hesitate to point out any errors  
you may find.

http://hem.bredband.net/b230591/code/ieee_float.zip


-- 
FE


Post a reply to this message

<<< Previous 9 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.