Re: Color table from TextAdapter

Hi Ugo-

Ugo Taddei wrote:
Hello everyone,

I want to load a user-defined color table from a text file. For that I want to define the color table as a VisAD Data object and read it off from a text file using VisAD's TextAdapter. (Actually, there's no need to define anything here, because the data object will be automagically created by the adapter...and I just want to get the RGB values as float[3][ N ].)

Has anyone got a snippet of code (that does exactly that) to donate to an open source project?

We define color tables using XML, but that entails adapting some
of our other code.  Although Bill doesn't officially endorse it,
there is a setFunction method of BaseColorControl.  So, you
maybe could define your text file to be a FlatField of
(index -> (r, g, b)) and then use the setFunction method.
(I'll let you work out the format of the file. ;-))
I think Donna Gresh has used this method successfully.

Don
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************



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