Logo Search packages:      
Sourcecode: jhdf version File versions  Download package

byte [][] ncsa::hdf::object::h5::H5ScalarDS::getPalette (  )  [inline, virtual]

Returns the palette of this scalar dataset or null if palette does not exist.

Scalar dataset can be displayed as spreadsheet data or image. When a scalar dataset is chosen to display as an image, the palette or color table may be needed to translate a pixel value to color components (for example, red, green, and blue). Some scalar datasets have no palette and some datasets have one or more than one palettes. If an associated palette exists but not loaded, this interface retrieves the palette from the file and returns the palette. If the palette is loaded, it returnd the palette. It returns null if there is no palette assciated with the dataset.

Current implementation only supports palette model of indexed RGB with 256 colors. Other models such as YUV", "CMY", "CMYK", "YCbCr", "HSV will be supported in the future.

The palette values are stored in a two-dimensional byte array and arrange by color components of red, green and blue. palette[][] = byte[3][256], where, palette[0][], palette[1][] and palette[2][] are the red, green and blue components respectively.

Sub-classes have to implement this interface. HDF4 and HDF5 images use different libraries to retrieve the associated palette.

Returns:
the 2D palette byte array.

Implements ncsa::hdf::object::ScalarDS.

Definition at line 923 of file H5ScalarDS.java.

References ncsa::hdf::object::ScalarDS::palette, and readPalette().

    {
        if (palette == null) {
            palette = readPalette(0);
        }

        return palette;
    }


Generated by  Doxygen 1.6.0   Back to index