/** Constructs a <code>ResolutionBox</code> based on the provided * <code>org.w3c.dom.Node</code>. */ public ResolutionBox(Node node) throws IIOInvalidTreeException { super(node); NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); String name = child.getNodeName(); if ("VerticalResolutionNumerator".equals(name)) { numV = Box.getShortElementValue(child); } if ("VerticalResolutionDenominator".equals(name)) { denomV = Box.getShortElementValue(child); } if ("HorizontalResolutionNumerator".equals(name)) { numH = Box.getShortElementValue(child); } if ("HorizontalResolutionDenominator".equals(name)) { denomH = Box.getShortElementValue(child); } if ("VerticalResolutionExponent".equals(name)) { expV = Box.getByteElementValue(child); } if ("HorizontalResolutionExponent".equals(name)) { expH = Box.getByteElementValue(child); } } }
num = Box.getShortElementValue(child); name = child.getNodeName(); if ("ChannelNumber".equals(name)) { channels[index] = Box.getShortElementValue(child); types[index] = Box.getShortElementValue(child); associations[index++] = Box.getShortElementValue(child);
/** Constructs a <code>UUIDListBox</code> based on the provided * <code>org.w3c.dom.Node</code>. */ public UUIDListBox(Node node) throws IIOInvalidTreeException { super(node); NodeList children = node.getChildNodes(); int index = 0; for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if ("NumberUUID".equals(child.getNodeName())) { num = (short)Box.getShortElementValue(child); uuids = new byte[num][]; } } for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if ("UUID".equals(child.getNodeName()) && index < num) { uuids[index++] = Box.getByteArrayElementValue(child); } } }
/** Constructs a <code>ComponentMappingBox</code> based on the provided * <code>org.w3c.dom.Node</code>. */ public ComponentMappingBox(Node node) throws IIOInvalidTreeException { super(node); NodeList children = node.getChildNodes(); int len = children.getLength() / 3; components = new short[len]; type = new byte[len]; map = new byte[len]; len *= 3; int index = 0; for (int i = 0; i < len; i++) { Node child = children.item(i); String name = child.getNodeName(); if ("Component".equals(name)) { components[index] = Box.getShortElementValue(child); } if ("ComponentType".equals(name)) { type[index] = Box.getByteElementValue(child); } if ("ComponentAssociation".equals(name)) { map[index++] = Box.getByteElementValue(child); } } }
/** Constructs an Image Header Box from a Node. */ public HeaderBox(Node node) throws IIOInvalidTreeException { super(node); NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); String name = child.getNodeName(); if ("Height".equals(name)) { height = Box.getIntElementValue(child); } if ("Width".equals(name)) { width = Box.getIntElementValue(child); } if ("NumComponents".equals(name)) { numComp = Box.getShortElementValue(child); } if ("BitDepth".equals(name)) { bitDepth = Box.getByteElementValue(child); } if ("CompressionType".equals(name)) { compressionType = Box.getByteElementValue(child); } if ("UnknownColorspace".equals(name)) { unknownColor = Box.getByteElementValue(child); } if ("IntellectualProperty".equals(name)) { intelProp = Box.getByteElementValue(child); } } }