POV-Ray : Newsgroups : povray.general : Creating 16-bit HFs from C++ : Re: Creating 16-bit HFs from C++ Server Time
2 Aug 2024 00:18:21 EDT (-0400)
  Re: Creating 16-bit HFs from C++  
From: Warp
Date: 21 Feb 2005 09:45:33
Message: <4219f40d@news.povray.org>
scott <sco### [at] spamcom> wrote:
> I'm writing some code in C++ (on windows) to generate some 16-bit height
> field data.  What is going to be the easiest way for me to export the
> numbers to use in POV?  The PNG file format looks pretty complex (compared
> to BMP which is what I'm used to).

  The png format is not intended to be read/written directly (unless you
are a really hardcore programmer... :P ) but there are libraries for
that purpose. Of course at least the most common png library is pretty
hard to use all on itself, but that's another issue... ;)

> Is there any way to make POV use red+256*green or something like that from a
> BMP file?  Or some software that will make red+256*green into 16-bit grey
> PNG?

  From http://povray.org/documentation/view/3.6.1/279/

"The TGA and PPM file formats may be used as a storage device for 16
bit numbers rather than an image file. These formats use the red and
green bytes of each pixel to store the high and low bytes of a height
value."

  The raw TGA file format is extremely simple. It has a 18-byte header
(which format is fixed) and then the raw image data.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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