Re: [idvusers] help with Blue Marble Images and IDV codebase

Hi Stuart-

Stuart Maclean wrote:
Alas the original color scheme does not seem to have been preserved,
as it was in the case of the VisAD code, i.e. using just Visad
objects, none from IDV.  How do I get my ImageRGBDisplayable to
preserve my source color palette?

You neeed to call setColorPalette with the gray color table.
Something like:

imageDisplayable.setColorPalette(visad.BaseColorControl.initTableGreyWedge(new float[3][255]);

Hi Don, the above addition of the setColorPalette worked a charm. Can you explain at all why it is needed and what it does? I am surprised that the default behavior is not to preserve the image pixel colors from the source image. Why does a grey scale help me out here?

The grey color table is a gradation of rgb values from 0 to 255
and we need that mapping so that the red,green, and blue colors of
the image get mapped to the appropriate byte values.  The default
color table in VisAD is not the grey table, but a blue to red
color table and that's what you got by default.  In that case
0,0,0 in your image was being mapped to 0,0,255 in the color table.
We should just make the default for the ImageRGBDisplayable use
the grey wedge.  I'll add that to the list of things to do.
The IDV does that automagically through the getInitialColorTable
method in ImageControl.

BTW are there any current developer docs I might glean info from?

Nothing that would help you with this issue.  That's just 10 years
of VisAD knowledge flowing out my ears. ;-)

The stable build (2.4b2) workshop docs have our recent IDV Developers
section in it which give some UML diagrams and explanations of the

under Section 6 - Java Developer Topics.

Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307