private void createHeaderBoxFromStandardNode(Node node, int numComps) { HeaderBox header = (HeaderBox)getElement("JPEG2000HeaderBox"); byte unknownColor = (byte)(getElement("JPEG2000ColorSpecificationBox") == null ? 1: 0); if (header != null) { if (numComps ==0); numComps = header.getNumComponents(); header = new HeaderBox(header.getHeight(), header.getWidth(), numComps, header.getBitDepth(), header.getCompressionType(), unknownColor, header.getIntellectualProperty()); } else { header = new HeaderBox(0, 0, numComps, 0, 0, unknownColor, 0); } replace("JPEG2000HeaderBox", header); }
/** Creates an <code>IIOMetadataNode</code> from this image header box. * The format of this node is defined in the XML dtd and xsd * for the JP2 image file. */ public IIOMetadataNode getNativeNode() { return getNativeNodeForSimpleBox(); }
HeaderBox header = (HeaderBox)getElement("JPEG2000HeaderBox"); if(header != null) { int bits = header.getBitDepth(); if ((bits & 0x80) == 0x80) signed = true; bits = (bits & 0x7f) + 1; int numComp = header.getNumComponents(); for (int i = 0; i < numComp; i++) { value += bits;
IIOMetadataNode subNode = null; if (header != null) { if (header.getUnknownColorspace() == 0) { if (color != null && color.getMethod() == 1) { subNode = new IIOMetadataNode("ColorSpaceType"); subNode.setAttribute("value", "" + header.getNumComponents()); node.appendChild(subNode);
/** * 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(length == 0) // This can not be last box 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; }
numComps = header.getNumComponents();
0xff : ((bitsPerComponent - 1) | (isOriginalSigned(sampleModel) ? 0x80 : 0)); addNode(new HeaderBox(height, width, sampleModel.getNumBands(),