Search in sources :

Example 11 with IIOMetadataNode

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;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 12 with IIOMetadataNode

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));
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 13 with IIOMetadataNode

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;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 14 with IIOMetadataNode

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;
}
Also used : ListIterator(java.util.ListIterator) Iterator(java.util.Iterator) IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 15 with IIOMetadataNode

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;
}
Also used : Iterator(java.util.Iterator) IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Aggregations

IIOMetadataNode (javax.imageio.metadata.IIOMetadataNode)65 Iterator (java.util.Iterator)5 IIOImage (javax.imageio.IIOImage)4 IIOMetadata (javax.imageio.metadata.IIOMetadata)4 Node (org.w3c.dom.Node)4 BufferedImage (java.awt.image.BufferedImage)3 ListIterator (java.util.ListIterator)3 ImageTypeSpecifier (javax.imageio.ImageTypeSpecifier)3 ImageWriter (javax.imageio.ImageWriter)3 ImageOutputStream (javax.imageio.stream.ImageOutputStream)3 Attr (org.w3c.dom.Attr)3 Graphics (java.awt.Graphics)2 Point (java.awt.Point)2 IndexColorModel (java.awt.image.IndexColorModel)2 ImageReader (javax.imageio.ImageReader)2 Element (org.w3c.dom.Element)2 ProductFlavorContainer (com.android.builder.model.ProductFlavorContainer)1 AndroidModel (com.android.tools.idea.model.AndroidModel)1 ChatPanel (com.glitchcog.fontificator.gui.chat.ChatPanel)1 Module (com.intellij.openapi.module.Module)1