Search in sources :

Example 1 with HeaderBox

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

the class FileFormatReader method readImageHeaderBox.

/**
 * This method reads the Image Header box
 * @param length The length of the JP2Header box
 *
 * @return false if the JP2Header box was not found or invalid else true
 *
 * @exception java.io.IOException If an I/O error ocurred.
 *
 * @exception java.io.EOFException If the end of file was reached
 */
public boolean readImageHeaderBox(int length) throws IOException, EOFException {
    if (// This can not be last box
    length == 0)
        throw new Error("Zero-length of JP2Header Box");
    // Here the JP2Header data (DBox) would be read if we were to use it
    height = in.readInt();
    width = in.readInt();
    numComp = in.readShort();
    bitDepth = in.readByte();
    compressionType = in.readByte();
    unknownColor = in.readByte();
    intelProp = in.readByte();
    if (metadata != null) {
        metadata.addNode(new HeaderBox(height, width, numComp, bitDepth, compressionType, unknownColor, intelProp));
    }
    return true;
}
Also used : HeaderBox(com.sun.media.imageioimpl.plugins.jpeg2000.HeaderBox)

Example 2 with HeaderBox

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

the class FileFormatReader method readImageHeaderBox.

/**
 * This method reads the Image Header box
 * @param length The length of the JP2Header box
 *
 * @return false if the JP2Header box was not found or invalid else true
 *
 * @exception java.io.IOException If an I/O error ocurred.
 *
 * @exception java.io.EOFException If the end of file was reached
 */
public boolean readImageHeaderBox(int length) throws IOException, EOFException {
    if (// This can not be last box
    length == 0)
        throw new Error("Zero-length of JP2Header Box");
    // Here the JP2Header data (DBox) would be read if we were to use it
    height = in.readInt();
    width = in.readInt();
    numComp = in.readShort();
    bitDepth = in.readByte();
    compressionType = in.readByte();
    unknownColor = in.readByte();
    intelProp = in.readByte();
    if (metadata != null) {
        metadata.addNode(new HeaderBox(height, width, numComp, bitDepth, compressionType, unknownColor, intelProp));
    }
    return true;
}
Also used : HeaderBox(com.sun.media.imageioimpl.plugins.jpeg2000.HeaderBox)

Aggregations

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