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

abstract byte [][] ncsa::hdf::object::ScalarDS::getPalette (  )  [pure 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.

the 2D palette byte array.

Implemented in ncsa::hdf::object::fits::FitsDataset, ncsa::hdf::object::h4::H4GRImage, ncsa::hdf::object::h4::H4SDS, ncsa::hdf::object::h5::H5ScalarDS, and ncsa::hdf::object::nc2::NC2Dataset.

Referenced by ncsa::hdf::view::DefaultImageView::getIndexedImage(), and test::unittests::H5ScalarDSTest::testGetPalette().

Generated by  Doxygen 1.6.0   Back to index