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

final void test::unittests::H5ScalarDSTest::testReadPalette (  )  [inline]

Test method for ncsa.hdf.object.h5.H5ScalarDS#readPalette(int).

What to test:

  • Get the palette from an image
  • Check the content of the palette

Definition at line 878 of file H5ScalarDSTest.java.

References ncsa::hdf::object::h5::H5File::get(), and ncsa::hdf::object::ScalarDS::readPalette().

        ScalarDS img = null;
        try {
            img = (ScalarDS)testFile.get(H5TestFile.NAME_DATASET_IMAGE);
        } catch (final Exception ex) {
            fail("testFile.get failed. "+ex);
        final byte[][] pal = img.readPalette(0);
        for (int i=0; i<256; i++) {
            assertEquals(H5TestFile.DATA_PALETTE[i*3],   pal[0][i]);
            assertEquals(H5TestFile.DATA_PALETTE[i*3+1], pal[1][i]);
            assertEquals(H5TestFile.DATA_PALETTE[i*3+2], pal[2][i]);

Generated by  Doxygen 1.6.0   Back to index