Search in sources :

Example 56 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project imageio-ext by geosolutions-it.

the class BaseJP2KBox method getNativeNode.

/**
 * Creates an <code>IIOMetadataNode</code> from this box. The format of
 * this node is defined in the XML dtd and xsd for the JP2 image file.
 */
public IIOMetadataNode getNativeNode() {
    String name = BoxUtilities.getName(getType());
    if (name == null)
        name = "unknown";
    IIOMetadataNode node = new IIOMetadataNode(name);
    setDefaultAttributes(node);
    IIOMetadataNode child = new IIOMetadataNode("Content");
    child.setUserObject(data);
    child.setNodeValue(ImageUtil.convertObjectToString(data));
    node.appendChild(child);
    return node;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 57 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project imageio-ext by geosolutions-it.

the class JP2KImageMetadata method createNativeTree.

private Node createNativeTree() {
    IIOMetadataNode rootNode = new IIOMetadataNode(nativeMetadataFormatName);
    IIOMetadataNode child;
    child = new IIOMetadataNode(HEIGHT);
    child.setUserObject(Integer.valueOf(height));
    child.setNodeValue(Integer.toString(height));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(WIDTH);
    child.setUserObject(Integer.valueOf(width));
    child.setNodeValue(Integer.toString(width));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(TILE_HEIGHT);
    child.setUserObject(Integer.valueOf(tileHeight));
    child.setNodeValue(Integer.toString(tileHeight));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(TILE_WIDTH);
    child.setUserObject(Integer.valueOf(tileWidth));
    child.setNodeValue(Integer.toString(tileWidth));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(NUM_COMPONENTS);
    child.setUserObject(Integer.valueOf(numComponents));
    child.setNodeValue(Integer.toString(numComponents));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(BITS_PER_COMPONENT);
    child.setUserObject(bitsPerComponent);
    child.setNodeValue(ImageUtil.convertObjectToString(bitsPerComponent));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(COMPONENT_INDEXES);
    child.setUserObject(componentIndexes);
    child.setNodeValue(ImageUtil.convertObjectToString(componentIndexes));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(IS_SIGNED);
    child.setUserObject(Boolean.valueOf(isSigned));
    child.setNodeValue(Boolean.toString(isSigned));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(MAX_QUALITY_LAYERS);
    child.setUserObject(Integer.valueOf(maxAvailableQualityLayers));
    child.setNodeValue(Integer.toString(maxAvailableQualityLayers));
    rootNode.appendChild(child);
    child = new IIOMetadataNode(DWT_LEVELS);
    child.setUserObject(Integer.valueOf(sourceDWTLevels));
    child.setNodeValue(Integer.toString(sourceDWTLevels));
    rootNode.appendChild(child);
    return rootNode;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 58 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project imageio-ext by geosolutions-it.

the class IPRBox method getNativeNode.

public IIOMetadataNode getNativeNode() {
    String name = BoxUtilities.getName(getType());
    IIOMetadataNode node = new IIOMetadataNode(name);
    return node;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 59 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project imageio-ext by geosolutions-it.

the class JP2KFileBox method getNativeNode.

public IIOMetadataNode getNativeNode() {
    String name = BoxUtilities.getName(getType());
    IIOMetadataNode node = new IIOMetadataNode(name);
    return node;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Example 60 with IIOMetadataNode

use of javax.imageio.metadata.IIOMetadataNode in project imageio-ext by geosolutions-it.

the class CompositingLayerHeaderBox method getNativeNode.

public IIOMetadataNode getNativeNode() {
    String name = BoxUtilities.getName(getType());
    if (name == null)
        name = "unknown";
    IIOMetadataNode node = new IIOMetadataNode(name);
    return node;
}
Also used : IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Aggregations

IIOMetadataNode (javax.imageio.metadata.IIOMetadataNode)132 Node (org.w3c.dom.Node)20 IIOMetadata (javax.imageio.metadata.IIOMetadata)12 NodeList (org.w3c.dom.NodeList)12 TIFFField (it.geosolutions.imageio.plugins.tiff.TIFFField)10 Iterator (java.util.Iterator)9 BufferedImage (java.awt.image.BufferedImage)8 ArrayList (java.util.ArrayList)8 ASOCBoxMetadataNode (it.geosolutions.imageio.plugins.jp2k.box.ASOCBoxMetadataNode)5 UUIDBoxMetadataNode (it.geosolutions.imageio.plugins.jp2k.box.UUIDBoxMetadataNode)5 XMLBoxMetadataNode (it.geosolutions.imageio.plugins.jp2k.box.XMLBoxMetadataNode)5 IOException (java.io.IOException)5 ImageOutputStream (javax.imageio.stream.ImageOutputStream)5 File (java.io.File)4 IIOImage (javax.imageio.IIOImage)4 ImageTypeSpecifier (javax.imageio.ImageTypeSpecifier)4 ImageWriter (javax.imageio.ImageWriter)4 TIFFTag (it.geosolutions.imageio.plugins.tiff.TIFFTag)3 Color (java.awt.Color)3 Point (java.awt.Point)3