Search in sources :

Example 21 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.

the class SOFMarkerSegment method getNativeNode.

IIOMetadataNode getNativeNode() {
    IIOMetadataNode node = new IIOMetadataNode("sof");
    node.setAttribute("process", Integer.toString(tag - JPEG.SOF0));
    node.setAttribute("samplePrecision", Integer.toString(samplePrecision));
    node.setAttribute("numLines", Integer.toString(numLines));
    node.setAttribute("samplesPerLine", Integer.toString(samplesPerLine));
    node.setAttribute("numFrameComponents", Integer.toString(componentSpecs.length));
    for (int i = 0; i < componentSpecs.length; i++) {
        node.appendChild(componentSpecs[i].getNativeNode());
    }
    return node;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 22 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.

the class BMPMetadata method addChildNode.

private IIOMetadataNode addChildNode(IIOMetadataNode root, String name, Object object) {
    IIOMetadataNode child = new IIOMetadataNode(name);
    if (object != null) {
        child.setUserObject(object);
        child.setNodeValue(ImageUtil.convertObjectToString(object));
    }
    root.appendChild(child);
    return child;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 23 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.

the class BMPMetadata method getStandardCompressionNode.

protected IIOMetadataNode getStandardCompressionNode() {
    IIOMetadataNode node = new IIOMetadataNode("Compression");
    // CompressionTypeName
    IIOMetadataNode subNode = new IIOMetadataNode("CompressionTypeName");
    subNode.setAttribute("value", BMPCompressionTypes.getName(compression));
    node.appendChild(subNode);
    return node;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 24 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project jdk8u_jdk by JetBrains.

the class BMPMetadata method getStandardDimensionNode.

protected IIOMetadataNode getStandardDimensionNode() {
    if (yPixelsPerMeter > 0.0F && xPixelsPerMeter > 0.0F) {
        IIOMetadataNode node = new IIOMetadataNode("Dimension");
        float ratio = yPixelsPerMeter / xPixelsPerMeter;
        IIOMetadataNode subNode = new IIOMetadataNode("PixelAspectRatio");
        subNode.setAttribute("value", "" + ratio);
        node.appendChild(subNode);
        subNode = new IIOMetadataNode("HorizontalPhysicalPixelSpacing");
        subNode.setAttribute("value", "" + (1 / xPixelsPerMeter * 1000));
        node.appendChild(subNode);
        subNode = new IIOMetadataNode("VerticalPhysicalPixelSpacing");
        subNode.setAttribute("value", "" + (1 / yPixelsPerMeter * 1000));
        node.appendChild(subNode);
        return node;
    }
    return null;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 25 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)

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