NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: converting HSV to RGB

Thank you Bill for your promt response. 

I still try to understand the principles of VisAD. That's the reason why I
have got further basic questions.

I want to put two indepented variables on the same 2D display. The
ScalarMap to Display.Hue is used to represent the expection- and the
ScalarMap to Display.Saturation  is used to represent the error
values. As I've written in my last mail I want to convert this HSV values
back to RGB. How can I generate the arrays of HSV values without using the
Display.HSV ? Or is there another solution to pass the values to the
toReference() method ?

Patrick 

On Mon, 14 Aug 2000, Bill Hibbard wrote:

> Hi Patrick,
> 
> > 1. In the BaseColorControl class there is a method for initializing RGB
> > colormap to HSV Values. Now, is it possible to convert the HSV values
> > back to RGB again ?
> 
> The toReference() method of visad/HSVCoordinateSystem.java
> converts arrays of HSV values to arrays of RGB values.
> 
> > 2. I also have got  problems with the getTable method. After defining the
> > display as follows, the getTable() methods return a NullPointerException.
> 
> The problem is that ScalarMaps to Hue and Saturation do
> not generate any Controls, so getControl() returns null.
> The mapping from exp to Hue is linear and controlled by
> setRange() calls on the ScalarMap itself.
> 
> A ScalarMap to Display.HSV will generate a ColorControl,
> which controls the mapping from RealType values to Hue,
> Saturation and Value.
> 
> > ...
> > ...
> > 
> > ScalarMap colMap = new ScalarMap(col, Display.XAxis);
> > ScalarMap rowMap = new ScalarMap(row, Display.YAxis);
> > ScalarMap expMap = new ScalarMap(exp, Display.Hue);
> > ScalarMap errMap = new ScalarMap(err, Display.Saturation);
> > ConstantMap constMap = new ConstantMap(1.0f, Display.Value);
> > 
> > display.addMap(colMap);
> > display.addMap(rowMap);
> > display.addMap(expMap);
> > display.addMap(errMap);
> > display.addMap(constMap);
> > 
> > ..
> > ..
> > 
> > ColorControl saturationControl = (ColorControl)errMap.getControl();
> > float[][] saturation = saturationControl.getTable();
> > 
> > ColorControl hueControl = (ColorControl)expMap.getControl();
> > float[][] hue = hueControl.getTable();
> 
> ----------------------------------------------------------
> Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
> hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
> http://www.ssec.wisc.edu/~billh/vis.html
> 


  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: