Search in sources :

Example 1 with ColorSpecificationBox

use of com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox in project bioformats by openmicroscopy.

the class FileFormatReader method readColourSpecificationBox.

/**
 * Read the color specifications.
 */
public void readColourSpecificationBox(int length) throws IOException {
    // read METHOD field
    byte method = (byte) in.readByte();
    // read PREC field
    byte prec = (byte) in.readByte();
    // read APPROX field
    byte approx = (byte) in.readByte();
    if (method == 2) {
        byte[] data = new byte[length - 3];
        in.readFully(data, 0, data.length);
        profile = ICC_Profile.getInstance(data);
    } else
        // read EnumCS field
        colorSpaceType = in.readInt();
    if (metadata != null) {
        metadata.addNode(new ColorSpecificationBox(method, prec, approx, colorSpaceType, profile));
    }
}
Also used : ColorSpecificationBox(com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox)

Example 2 with ColorSpecificationBox

use of com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox in project bioformats by ome.

the class FileFormatReader method readColourSpecificationBox.

/**
 * Read the color specifications.
 */
public void readColourSpecificationBox(int length) throws IOException {
    // read METHOD field
    byte method = (byte) in.readByte();
    // read PREC field
    byte prec = (byte) in.readByte();
    // read APPROX field
    byte approx = (byte) in.readByte();
    if (method == 2) {
        byte[] data = new byte[length - 3];
        in.readFully(data, 0, data.length);
        profile = ICC_Profile.getInstance(data);
    } else
        // read EnumCS field
        colorSpaceType = in.readInt();
    if (metadata != null) {
        metadata.addNode(new ColorSpecificationBox(method, prec, approx, colorSpaceType, profile));
    }
}
Also used : ColorSpecificationBox(com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox)

Aggregations

ColorSpecificationBox (com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox)2