use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.
the class BMPMetadata method getStandardChromaNode.
// Standard tree node methods
protected IIOMetadataNode getStandardChromaNode() {
if ((palette != null) && (paletteSize > 0)) {
IIOMetadataNode node = new IIOMetadataNode("Chroma");
IIOMetadataNode subNode = new IIOMetadataNode("Palette");
int numComps = palette.length / paletteSize;
subNode.setAttribute("value", "" + numComps);
for (int i = 0, j = 0; i < paletteSize; i++) {
IIOMetadataNode subNode1 = new IIOMetadataNode("PaletteEntry");
subNode1.setAttribute("index", "" + i);
subNode1.setAttribute("red", "" + palette[j++]);
subNode1.setAttribute("green", "" + palette[j++]);
subNode1.setAttribute("blue", "" + palette[j++]);
if (numComps == 4 && palette[j] != 0)
subNode1.setAttribute("alpha", "" + palette[j++]);
subNode.appendChild(subNode1);
}
node.appendChild(subNode);
return node;
}
return null;
}
use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.
the class BMPMetadata method addXYZPoints.
private void addXYZPoints(IIOMetadataNode root, String name, double x, double y, double z) {
IIOMetadataNode node = addChildNode(root, name, null);
addChildNode(node, "X", new Double(x));
addChildNode(node, "Y", new Double(y));
addChildNode(node, "Z", new Double(z));
}
use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.
the class AdobeMarkerSegment method getNativeNode.
IIOMetadataNode getNativeNode() {
IIOMetadataNode node = new IIOMetadataNode("app14Adobe");
node.setAttribute("version", Integer.toString(version));
node.setAttribute("flags0", Integer.toString(flags0));
node.setAttribute("flags1", Integer.toString(flags1));
node.setAttribute("transform", Integer.toString(transform));
return node;
}
use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.
the class JPEGMetadata method getStandardTextNode.
protected IIOMetadataNode getStandardTextNode() {
IIOMetadataNode text = null;
// Add a text entry for each COM Marker Segment
if (findMarkerSegment(JPEG.COM) != null) {
text = new IIOMetadataNode("Text");
Iterator iter = markerSequence.iterator();
while (iter.hasNext()) {
MarkerSegment seg = (MarkerSegment) iter.next();
if (seg.tag == JPEG.COM) {
COMMarkerSegment com = (COMMarkerSegment) seg;
IIOMetadataNode entry = new IIOMetadataNode("TextEntry");
entry.setAttribute("keyword", "comment");
entry.setAttribute("value", com.getComment());
text.appendChild(entry);
}
}
}
return text;
}
use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.
the class JFIFMarkerSegment method getNativeNode.
/**
* Returns a tree of DOM nodes representing this object and any
* subordinate JFXX extension or ICC Profile segments.
*/
IIOMetadataNode getNativeNode() {
IIOMetadataNode node = new IIOMetadataNode("app0JFIF");
node.setAttribute("majorVersion", Integer.toString(majorVersion));
node.setAttribute("minorVersion", Integer.toString(minorVersion));
node.setAttribute("resUnits", Integer.toString(resUnits));
node.setAttribute("Xdensity", Integer.toString(Xdensity));
node.setAttribute("Ydensity", Integer.toString(Ydensity));
node.setAttribute("thumbWidth", Integer.toString(thumbWidth));
node.setAttribute("thumbHeight", Integer.toString(thumbHeight));
if (!extSegments.isEmpty()) {
IIOMetadataNode JFXXnode = new IIOMetadataNode("JFXX");
node.appendChild(JFXXnode);
for (Iterator iter = extSegments.iterator(); iter.hasNext(); ) {
JFIFExtensionMarkerSegment seg = (JFIFExtensionMarkerSegment) iter.next();
JFXXnode.appendChild(seg.getNativeNode());
}
}
if (iccSegment != null) {
node.appendChild(iccSegment.getNativeNode());
}
return node;
}
Aggregations