POV-Ray : Newsgroups : povray.newusers : Wavelength to RGB converter? : Re: Wavelength to RGB converter? Server Time
31 Jul 2024 02:29:00 EDT (-0400)
  Re: Wavelength to RGB converter?  
From: Kaveh
Date: 1 Mar 2003 10:49:26
Message: <1fr5fsj.1beeuyb1xw7s8mN%kaveh@delete_this.focalimage.com>
Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:

> On Sat, 1 Mar 2003 11:01:42 +0000
> kav### [at] delete_thisfocalimagecom (Kaveh) wrote:
> 
> > I want the old image to be shown in the original wavelength colour,
> > and the new one in the colour of the new wavelength, as closely as
> > practical. So for each wavelength there would be a value in a lookup
> > table for the RGB to use.
> > 
> > When we use a large number of wavelengths, as in white light, I want
> > to see a more or less continuous spectrum of light, with each spectral
> > image in its correct position.
> 
>   Check CIE.inc conained on my lightsys package (Ive posted the URL on
> a previous reply). It has some macros to convert wavelength to several
> RGB color systems, based on the CIE XYZ color space tranformations. Ive
> done all this job alone, as a replacement for my lightsys color macros,
> which used a poor aproximation at first based on Dan Bruton algorithm.
> 
>   Using CIE.inc, you sould be done with the Wavelength(W) macro, where
> W is the wavelength in nm.( the default color system is sRGB). Have fun!

I just downloaded all those and saw that. It is *exactly* what I need.
And congratulations for doing so much work on color. It's not an easy
field!

I am probably doing something silly here, but when I run your test file:

===============
    #include "lightsys.inc"            // main include
    #include "lightsys_CIE-sRGB"       // saved rgb values for common
colors
    
    // global variables
    #declare BRIGTHNESS=1.25;              // a little "overexposed"
    #declare WHITE_POINT=Wp_Daylight_Film; // translate white point to
5500K 
    #declare COLOR_FILTER=CC05R;           // 5% CC red filter

    // obtain a light_source
    object{
     Light(Cl_Cool_White_Fluor,Lm_Fluorescent_15w,9*x,9*z,4,4,0)
    }
===============

I get an error:

===============
Parsing...File: rgbtest.pov  Line: 1

    #include "lightsys_CIE-sRGB"

    #declare WHITE_POINT=Wp_Daylight_F     // a little "overexposed"

ilm <----ERROR

Parse Error: Cannot assign uninitialized identifier.
===============

It complains that Wp_Daylight_Film is not initialized, but it is, in
lightsys_CIE-sRGB. Can you see what I am doing wrong?

-- 
Kaveh


Post a reply to this message

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