POV-Ray : Newsgroups : povray.general : Feature idea: Compile to data file option : Re: Feature idea: Compile to data file option Server Time
7 Aug 2024 13:16:40 EDT (-0400)
  Re: Feature idea: Compile to data file option  
From: Peter J  Holzer
Date: 21 Oct 2001 14:00:49
Message: <slrn9t5t3g.61k.hjp-usenet@teal.h.hjp.at>
On 2001-10-21 07:13, Christoph Hormann <chr### [at] gmxde> wrote:
> "Peter J. Holzer" wrote:
>> 
>> Only 33 % if you use base 64 encoding. How do you get a factor of 3-4?
>> 
> 
> I thought of a human readable form.

A human readable ASCII form for images? Like PPM ASCII or XPM? You get
much more than a factor of 3-4 for these compared to JPG (I just
converted a 600x600 pixel JPG (83k) to PPM: 4.2M, or a factor of 51!),
and they aren't really human readable except for tiny sizes. 

>> > Remember that floating point numbers in binaries are not platform
>> > independant.
>> 
>> Neither are integers. If you define a portable binary format, you will
>> have to define the format of all its components, too.
> 
> Reading integer files cross platform is not difficult, you just have to
> take care of the byte order, which is easy and does not take much time,
> see for example the png file format.  I don't know any file format which
> works this way for floating point numbers.

Just chose one: IEEE-754 big-endian for example.

Converting between different FP formats usually isn't more than
bitshifting, either. For the common case (IEEE-754 big- or little
endian) you can implement a "fast path" which reads directly or only
swaps bytes, for the rest you can implement a portable C version (this
is not completely trivial, but shouldn't be too difficult either - I
might take a stab at it just as a "proof of concept"). Or you can ignore
them completely, just as you can ignore ones-complement integers and
PDP-endian longs[1].

	hp

[1] Ok, I admit that I don't know any current architecture which doesn't
use strict big/little-endian twos-complement integers, but I know at
least two (Alpha in VAX-compatibility mode, Cray) which don't use
IEEE-754. However, Povray must be compiled in IEEE-754 mode on the Alpha
to work at all (The alpha will trap on denormalized numbers otherwise)
and I don't know enough about the Cray to know if that's a problem.

-- 
   _  | Peter J. Holzer    | Oder glaubst du "Bugtraq" waere eine
|_|_) | Sysadmin WSR       | Science-Fiction TV-Serie ueber Schaben
| |   | hjp### [at] hjpat         | im Weltall?
__/   | http://www.hjp.at/ |	-- Juergen P. Meier in dcsm


Post a reply to this message

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