本文整理匯總了Java中javax.imageio.metadata.IIOMetadataNode.appendChild方法的典型用法代碼示例。如果您正苦於以下問題:Java IIOMetadataNode.appendChild方法的具體用法?Java IIOMetadataNode.appendChild怎麽用?Java IIOMetadataNode.appendChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.imageio.metadata.IIOMetadataNode
的用法示例。
在下文中一共展示了IIOMetadataNode.appendChild方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getNativeNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
/**
* 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<JFIFExtensionMarkerSegment> iter =
extSegments.iterator(); iter.hasNext();) {
JFIFExtensionMarkerSegment seg = iter.next();
JFXXnode.appendChild(seg.getNativeNode());
}
}
if (iccSegment != null) {
node.appendChild(iccSegment.getNativeNode());
}
return node;
}
示例2: getNativeNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
IIOMetadataNode getNativeNode() {
IIOMetadataNode node = new IIOMetadataNode("sos");
node.setAttribute("numScanComponents",
Integer.toString(componentSpecs.length));
node.setAttribute("startSpectralSelection",
Integer.toString(startSpectralSelection));
node.setAttribute("endSpectralSelection",
Integer.toString(endSpectralSelection));
node.setAttribute("approxHigh",
Integer.toString(approxHigh));
node.setAttribute("approxLow",
Integer.toString(approxLow));
for (int i = 0; i < componentSpecs.length; i++) {
node.appendChild(componentSpecs[i].getNativeNode());
}
return node;
}
示例3: getNativeNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
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;
}
示例4: getStandardChromaNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
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;
}
示例5: getStandardDataNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
protected IIOMetadataNode getStandardDataNode() {
IIOMetadataNode node = new IIOMetadataNode("Data");
String bits = "";
if (bitsPerPixel == 24)
bits = "8 8 8 ";
else if (bitsPerPixel == 16 || bitsPerPixel == 32) {
bits = "" + countBits(redMask) + " " + countBits(greenMask) +
countBits(blueMask) + "" + countBits(alphaMask);
}
IIOMetadataNode subNode = new IIOMetadataNode("BitsPerSample");
subNode.setAttribute("value", bits);
node.appendChild(subNode);
return node;
}
示例6: getNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
public IIOMetadataNode getNode() {
IIOMetadataNode iTXt = new IIOMetadataNode("iTXt");
IIOMetadataNode iTXtEntry = new IIOMetadataNode("iTXtEntry");
iTXtEntry.setAttribute("keyword", keyword);
iTXtEntry.setAttribute("compressionFlag",
isCompressed ? "true" : "false");
iTXtEntry.setAttribute("compressionMethod",
Integer.toString(compression));
iTXtEntry.setAttribute("languageTag", language);
iTXtEntry.setAttribute("translatedKeyword",
trasKeyword);
iTXtEntry.setAttribute("text", text);
iTXt.appendChild(iTXtEntry);
return iTXt;
}
示例7: getNativeNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
IIOMetadataNode getNativeNode() {
IIOMetadataNode node = new IIOMetadataNode("dqt");
for (int i= 0; i<tables.size(); i++) {
Qtable table = tables.get(i);
node.appendChild(table.getNativeNode());
}
return node;
}
示例8: getNativeNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
IIOMetadataNode getNativeNode() {
IIOMetadataNode node = new IIOMetadataNode("JFIFthumbJPEG");
if (thumbMetadata != null) {
node.appendChild(thumbMetadata.getNativeTree());
}
return node;
}
示例9: createNativeMetadataNodeTree
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
public static IIOMetadataNode createNativeMetadataNodeTree() {
// Create a text node to hold tEXtEntries
IIOMetadataNode tEXtNode = new IIOMetadataNode("tEXt");
// Create tEXt entry to hold random date time
IIOMetadataNode randomTimeEntry = new IIOMetadataNode("tEXtEntry");
randomTimeEntry.setAttribute("keyword", "Creation Time");
randomTimeEntry.setAttribute("value", "21 Dec 2015,Monday");
tEXtNode.appendChild(randomTimeEntry);
// Create a tEXt entry to hold time in RFC1123 format
IIOMetadataNode rfcTextEntry = new IIOMetadataNode("tEXtEntry");
rfcTextEntry.setAttribute("keyword", "Creation Time");
rfcTextEntry.setAttribute("value", "Mon, 21 Dec 2015 09:04:30 +0530");
tEXtNode.appendChild(rfcTextEntry);
// Create a tEXt entry to hold time in ISO format
IIOMetadataNode isoTextEntry = new IIOMetadataNode("tEXtEntry");
isoTextEntry.setAttribute("keyword", "Creation Time");
isoTextEntry.setAttribute("value", "2014-12-21T09:04:30+05:30");
tEXtNode.appendChild(isoTextEntry);
// Create a root node append the text node
IIOMetadataNode root = new IIOMetadataNode("javax_imageio_png_1.0");
root.appendChild(tEXtNode);
return root;
}
示例10: addChildNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
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;
}
示例11: getStandardChromaNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
protected IIOMetadataNode getStandardChromaNode() {
IIOMetadataNode node = new IIOMetadataNode("Chroma");
IIOMetadataNode subNode = new IIOMetadataNode("BlackIsZero");
subNode.setAttribute("value", "TRUE");
node.appendChild(subNode);
return node;
}
示例12: getStandardCompressionNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
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;
}
示例13: getStandardDimensionNode
import javax.imageio.metadata.IIOMetadataNode; //導入方法依賴的package包/類
protected IIOMetadataNode getStandardDimensionNode() {
// If we have a JFIF marker segment, we know a little
// otherwise all we know is the orientation, which is always normal
IIOMetadataNode dim = new IIOMetadataNode("Dimension");
IIOMetadataNode orient = new IIOMetadataNode("ImageOrientation");
orient.setAttribute("value", "normal");
dim.appendChild(orient);
JFIFMarkerSegment jfif =
(JFIFMarkerSegment) findMarkerSegment(JFIFMarkerSegment.class, true);
if (jfif != null) {
// Aspect Ratio is width of pixel / height of pixel
float aspectRatio;
if (jfif.resUnits == 0) {
// In this case they just encode aspect ratio directly
aspectRatio = ((float) jfif.Xdensity)/jfif.Ydensity;
} else {
// They are true densities (e.g. dpi) and must be inverted
aspectRatio = ((float) jfif.Ydensity)/jfif.Xdensity;
}
IIOMetadataNode aspect = new IIOMetadataNode("PixelAspectRatio");
aspect.setAttribute("value", Float.toString(aspectRatio));
dim.insertBefore(aspect, orient);
// Pixel size
if (jfif.resUnits != 0) {
// 1 == dpi, 2 == dpc
float scale = (jfif.resUnits == 1) ? 25.4F : 10.0F;
IIOMetadataNode horiz =
new IIOMetadataNode("HorizontalPixelSize");
horiz.setAttribute("value",
Float.toString(scale/jfif.Xdensity));
dim.appendChild(horiz);
IIOMetadataNode vert =
new IIOMetadataNode("VerticalPixelSize");
vert.setAttribute("value",
Float.toString(scale/jfif.Ydensity));
dim.appendChild(vert);
}
}
return dim;
}