本文整理汇总了Java中javax.imageio.metadata.IIOMetadataFormatImpl类的典型用法代码示例。如果您正苦于以下问题:Java IIOMetadataFormatImpl类的具体用法?Java IIOMetadataFormatImpl怎么用?Java IIOMetadataFormatImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IIOMetadataFormatImpl类属于javax.imageio.metadata包,在下文中一共展示了IIOMetadataFormatImpl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getAsTree
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
public Node getAsTree(String formatName) {
if (formatName == null) {
throw new IllegalArgumentException("null formatName!");
}
if (isStream) {
if (formatName.equals(JPEG.nativeStreamMetadataFormatName)) {
return getNativeTree();
}
} else {
if (formatName.equals(JPEG.nativeImageMetadataFormatName)) {
return getNativeTree();
}
if (formatName.equals
(IIOMetadataFormatImpl.standardMetadataFormatName)) {
return getStandardTree();
}
}
throw new IllegalArgumentException("Unsupported format name: "
+ formatName);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:JPEGMetadata.java
示例2: setFromTree
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
public void setFromTree(String formatName, Node root)
throws IIOInvalidTreeException {
if (formatName == null) {
throw new IllegalArgumentException("null formatName!");
}
if (root == null) {
throw new IllegalArgumentException("null root!");
}
if (isStream &&
(formatName.equals(JPEG.nativeStreamMetadataFormatName))) {
setFromNativeTree(root);
} else if (!isStream &&
(formatName.equals(JPEG.nativeImageMetadataFormatName))) {
setFromNativeTree(root);
} else if (!isStream &&
(formatName.equals
(IIOMetadataFormatImpl.standardMetadataFormatName))) {
// In this case a reset followed by a merge is correct
super.setFromTree(formatName, root);
} else {
throw new IllegalArgumentException("Unsupported format name: "
+ formatName);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:JPEGMetadata.java
示例3: mergeTree
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
public void mergeTree(String formatName, Node root)
throws IIOInvalidTreeException {
if (formatName.equals(nativeMetadataFormatName)) {
if (root == null) {
throw new IllegalArgumentException("root == null!");
}
mergeNativeTree(root);
} else if (formatName.equals
(IIOMetadataFormatImpl.standardMetadataFormatName)) {
if (root == null) {
throw new IllegalArgumentException("root == null!");
}
mergeStandardTree(root);
} else {
throw new IllegalArgumentException("Not a recognized format!");
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:GIFMetadata.java
示例4: mergeTree
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
public void mergeTree(String formatName, Node root)
throws IIOInvalidTreeException {
if (formatName.equals(nativeMetadataFormatName)) {
if (root == null) {
throw new IllegalArgumentException("root == null!");
}
mergeNativeTree(root);
} else if (formatName.equals
(IIOMetadataFormatImpl.standardMetadataFormatName)) {
if (root == null) {
throw new IllegalArgumentException("root == null!");
}
mergeStandardTree(root);
} else {
throw new IllegalArgumentException("Not a recognized format!");
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:GIFWritableStreamMetadata.java
示例5: mergeTree
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
public void mergeTree(String formatName, Node root)
throws IIOInvalidTreeException {
if (formatName.equals(nativeMetadataFormatName)) {
if (root == null) {
throw new IllegalArgumentException("root == null!");
}
mergeNativeTree(root);
} else if (formatName.equals
(IIOMetadataFormatImpl.standardMetadataFormatName)) {
if (root == null) {
throw new IllegalArgumentException("root == null!");
}
mergeStandardTree(root);
} else {
throw new IllegalArgumentException("Not a recognized format!");
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:PNGMetadata.java
示例6: convertStandardImageMetadata
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
/**
* Converts a standard {@code javax_imageio_1.0} tree to a
* {@code TIFFImageMetadata} object.
*
* @param inData The metadata object.
* @return a {@code TIFFImageMetadata} or {@code null} if
* the standard tree derived from the input object is {@code null}.
* @throws IllegalArgumentException if {@code inData} is
* {@code null}.
* @throws IllegalArgumentException if {@code inData} does not support
* the standard metadata format.
* @throws IIOInvalidTreeException if {@code inData} generates an
* invalid standard metadata tree.
*/
private TIFFImageMetadata convertStandardImageMetadata(IIOMetadata inData)
throws IIOInvalidTreeException {
if(inData == null) {
throw new NullPointerException("inData == null!");
} else if(!inData.isStandardMetadataFormatSupported()) {
throw new IllegalArgumentException
("inData does not support standard metadata format!");
}
TIFFImageMetadata outData = null;
String formatName = IIOMetadataFormatImpl.standardMetadataFormatName;
Node tree = inData.getAsTree(formatName);
if (tree != null) {
List<TIFFTagSet> tagSets = new ArrayList<TIFFTagSet>(1);
tagSets.add(BaselineTIFFTagSet.getInstance());
outData = new TIFFImageMetadata(tagSets);
outData.setFromTree(formatName, tree);
}
return outData;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:TIFFImageWriter.java
示例7: mergeTree
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
public void mergeTree(String formatName, Node root)
throws IIOInvalidTreeException{
if (formatName.equals(nativeMetadataFormatName)) {
if (root == null) {
throw new NullPointerException("root == null!");
}
mergeNativeTree(root);
} else if (formatName.equals
(IIOMetadataFormatImpl.standardMetadataFormatName)) {
if (root == null) {
throw new NullPointerException("root == null!");
}
mergeStandardTree(root);
} else {
throw new IllegalArgumentException("Not a recognized format!");
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:TIFFImageMetadata.java
示例8: main
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
// Generate some trivial image and save it to a temporary array
ByteArrayOutputStream tmp = new ByteArrayOutputStream();
ImageIO.write(new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB),
"gif", tmp);
// Read the stream
ImageInputStream in = new MemoryCacheImageInputStream(
new ByteArrayInputStream(tmp.toByteArray()));
ImageReader reader = ImageIO.getImageReaders(in).next();
reader.setInput(in);
// Retrieve standard image metadata tree
IIOMetadata meta = reader.getImageMetadata(0);
if (meta == null || !meta.isStandardMetadataFormatSupported()) {
throw new Error("Test failure: Missing metadata");
}
Element root = (Element) meta.
getAsTree(IIOMetadataFormatImpl.standardMetadataFormatName);
// Test getElementsByTagName("*")
if (root.getElementsByTagName("*").getLength() == 0) {
throw new RuntimeException("getElementsByTagName(\"*\") returns"
+ " nothing");
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:GetElementsByTagNameTest.java
示例9: main
import javax.imageio.metadata.IIOMetadataFormatImpl; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
String fileName = "nomarkers.jpg";
String sep = System.getProperty("file.separator");
String dir = System.getProperty("test.src", ".");
String filePath = dir+sep+fileName;
System.out.println("Test file: " + filePath);
File file = new File(filePath);
ImageInputStream stream = ImageIO.createImageInputStream(file);
Iterator<ImageReader> readers = ImageIO.getImageReaders(stream);
if(readers.hasNext()) {
ImageReader reader = readers.next();
reader.setInput(stream);
IIOMetadata metadata = reader.getImageMetadata(0);
IIOMetadataNode standardTree = (IIOMetadataNode)
metadata.getAsTree
(IIOMetadataFormatImpl.standardMetadataFormatName);
IIOMetadataNode colorSpaceType = (IIOMetadataNode)
standardTree.getElementsByTagName("ColorSpaceType").item(0);
String colorSpaceName = colorSpaceType.getAttribute("name");
if(colorSpaceName.equals("RGB"))
throw new RuntimeException("Identified incorrect ColorSpace");
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:JpegMetadataColorSpaceTest.java
注:本文中的javax.imageio.metadata.IIOMetadataFormatImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论