private void parse_cHRM_chunk(PNGChunk chunk) {
        // If an sRGB chunk exists, ignore cHRM chunks
        if (sRGBRenderingIntent != -1) {
            return;
        }

        chromaticity = new float[8];
        chromaticity[0] = chunk.getInt4(0)/100000.0F;
        chromaticity[1] = chunk.getInt4(4)/100000.0F;
        chromaticity[2] = chunk.getInt4(8)/100000.0F;
        chromaticity[3] = chunk.getInt4(12)/100000.0F;
        chromaticity[4] = chunk.getInt4(16)/100000.0F;
        chromaticity[5] = chunk.getInt4(20)/100000.0F;
        chromaticity[6] = chunk.getInt4(24)/100000.0F;
        chromaticity[7] = chunk.getInt4(28)/100000.0F;

        if (encodeParam != null) {
            encodeParam.setChromaticity(chromaticity);
        }
        if (emitProperties) {
            properties.put("white_point_x", new Float(chromaticity[0]));
            properties.put("white_point_y", new Float(chromaticity[1]));
            properties.put("red_x", new Float(chromaticity[2]));
            properties.put("red_y", new Float(chromaticity[3]));
            properties.put("green_x", new Float(chromaticity[4]));
            properties.put("green_y", new Float(chromaticity[5]));
            properties.put("blue_x", new Float(chromaticity[6]));
            properties.put("blue_y", new Float(chromaticity[7]));
        }
    }
A convenience method to create an instance of
<code>ComponentColorModel</code> suitable for use with the
given <code>SampleModel</code>.  The <code>SampleModel</code>
should have a data type of <code>DataBuffer.TYPE_BYTE</code>,
<code>TYPE_USHORT</code>, or <code>TYPE_INT</code> and between
1 and 4 bands.  Depending on the number of bands of the
<code>SampleModel</code>, either a gray, gray+alpha, rgb, or
rgb+alpha <code>ColorModel</code> is returned.
plugins/svg-plugin/batik-codec-fix/src/main/java/org/apache/batik/ext/awt/image/codec/png/PNGImageDecoder.java