Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ice-dev] ColorMap widget

Hi Jordan,

Below is an example from the Python API of what the internal infrastructure looks like.

Below is code for the default "hot" colormap. As you can see the position is placed in a 0 to 1 range. And, at specific points you can added colors values. VisIt allows you to set other options like types of smoothing, spacing, discrete or not, and a categoryName.

GetControlPoints(0).colors = (0, 0, 255, 255)
GetControlPoints(0).position = 0
GetControlPoints(1).colors = (0, 255, 255, 255)
GetControlPoints(1).position = 0.25
GetControlPoints(2).colors = (0, 255, 0, 255)
GetControlPoints(2).position = 0.5
GetControlPoints(3).colors = (255, 255, 0, 255)
GetControlPoints(3).position = 0.75
GetControlPoints(4).colors = (255, 0, 0, 255)
GetControlPoints(4).position = 1
smoothing = Linear  # None, Linear, CubicSpline
equalSpacingFlag = 0
discreteFlag = 0
categoryName = "Standard"

What this means is that as long as we can set a sequence of colors and a position on a range from 0-1, we should be able to map any concrete implementation to a version VisIt can understand.

Best regards,
Hari

P.S.  Below is an example of a colormap written in xml that VisIt can parse.

<?xml version="1.0"?>
<Object name="ColorTable">
    <Field name="Version" type="string">2.8.1</Field>
    <Object name="ColorControlPointList">
        <Object name="ColorControlPoint">
            <Field name="colors" type="unsignedCharArray" length="4">116 42 19 255 </Field>
            <Field name="position" type="float">0.143312</Field>
        </Object>
        <Object name="ColorControlPoint">
            <Field name="colors" type="unsignedCharArray" length="4">212 177 149 255 </Field>
            <Field name="position" type="float">0.401274</Field>
        </Object>
        <Object name="ColorControlPoint">
            <Field name="colors" type="unsignedCharArray" length="4">181 131 108 255 </Field>
            <Field name="position" type="float">0.726115</Field>
        </Object>
        <Object name="ColorControlPoint">
            <Field name="colors" type="unsignedCharArray" length="4">209 168 73 255 </Field>
            <Field name="position" type="float">1</Field>
        </Object>
        <Field name="category" type="string">UserDefined</Field>
    </Object>
</Object>


On Fri, Dec 19, 2014 at 1:27 PM, Jordan Deyton <jordan.deyton@xxxxxxxxx> wrote:
Hari,

Taylor created a feature request for the ColorMap widget.

During the status meeting, you mentioned that VisIt needs a sequence of numbers from 0 to 1. Can you elaborate a little more on the specific requirements to send a color map to VisIt?

I'm looking at possibly re-using SWT XYGraph's ColorMap, but I'm not yet sure if it's a perfect fit or if we'll have to put a little effort into adapting it for use in VisIt (and ICE).

Thanks,
Jordan

Back to the top