POV-Ray : Newsgroups : povray.general : df3 with Java? : Re: df3 with Java? Server Time
3 Aug 2024 14:18:59 EDT (-0400)
  Re: df3 with Java?  
From: Christopher James Huff
Date: 8 Feb 2004 16:57:21
Message: <cjameshuff-F283C5.16573808022004@news.povray.org>
In article <4026a96c$1@news.povray.org>,
 "Tim Nikias v2.0" <tim.nikias (@) nolights.de> wrote:

> That's the tricky bit: the conversion. I don't know the commands/libraries
> I'd have to use with Java to convert float/double to bytes, and then again
> which commands/libraries I'd have to use to write them to disk. I'll go
> around searching once I actually attempt a df3 stunt, but I thought maybe
> someone has had experience with that already, so I asked.

The Java I/O classes have methods for writing binary data byte-by-byte. 
If you have floating point data with a range of [0, 1], just multiply it 
by 255 and convert to a byte, and write that byte value.


> Is it possible to use more than just a single byte? Or would I be getting
> myself into trouble (file format-wise) with that?

No, it is not, no more possible than it is to put 16 bit values in an 
8-bit component of any image format. The entire file has to be 8, 16, or 
24 bit.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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