本文整理汇总了Java中org.apache.commons.imaging.ImageFormats.ICNS属性的典型用法代码示例。如果您正苦于以下问题:Java ImageFormats.ICNS属性的具体用法?Java ImageFormats.ICNS怎么用?Java ImageFormats.ICNS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.imaging.ImageFormats
的用法示例。
在下文中一共展示了ImageFormats.ICNS属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toICNS
public void toICNS(String resolution, String destination, boolean appendResolution) {
ImageTransformEntry imageTransformEntry = new ImageTransformEntry();
imageTransformEntry.resolution = resolution;
imageTransformEntry.destination = destination;
imageTransformEntry.source = sourcePath;
imageTransformEntry.appendResolution = appendResolution;
imageTransformEntry.format = ImageFormats.ICNS;
transformEntries.add(imageTransformEntry);
}
示例2: getImageInfo
@Override
public ImageInfo getImageInfo(final ByteSource byteSource, Map<String, Object> params)
throws ImageReadException, IOException {
// make copy of params; we'll clear keys as we consume them.
params = (params == null) ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
if (params.containsKey(PARAM_KEY_VERBOSE)) {
params.remove(PARAM_KEY_VERBOSE);
}
if (!params.isEmpty()) {
final Object firstKey = params.keySet().iterator().next();
throw new ImageReadException("Unknown parameter: " + firstKey);
}
final IcnsContents contents = readImage(byteSource);
final List<BufferedImage> images = IcnsDecoder
.decodeAllImages(contents.icnsElements);
if (images.isEmpty()) {
throw new ImageReadException("No icons in ICNS file");
}
final BufferedImage image0 = images.get(0);
return new ImageInfo("Icns", 32, new ArrayList<String>(),
ImageFormats.ICNS, "ICNS Apple Icon Image",
image0.getHeight(), "image/x-icns", images.size(), 0, 0, 0, 0,
image0.getWidth(), false, true, false,
ImageInfo.COLOR_TYPE_RGB,
ImageInfo.COMPRESSION_ALGORITHM_UNKNOWN);
}
示例3: getImageInfo
@Override
public ImageInfo getImageInfo(final ByteSource byteSource, Map<String, Object> params)
throws ImageReadException, IOException {
// make copy of params; we'll clear keys as we consume them.
params = params == null ? new HashMap<String, Object>() : new HashMap<>(params);
if (params.containsKey(PARAM_KEY_VERBOSE)) {
params.remove(PARAM_KEY_VERBOSE);
}
if (!params.isEmpty()) {
final Object firstKey = params.keySet().iterator().next();
throw new ImageReadException("Unknown parameter: " + firstKey);
}
final IcnsContents contents = readImage(byteSource);
final List<BufferedImage> images = IcnsDecoder.decodeAllImages(contents.icnsElements);
if (images.isEmpty()) {
throw new ImageReadException("No icons in ICNS file");
}
final BufferedImage image0 = images.get(0);
return new ImageInfo("Icns", 32, new ArrayList<String>(),
ImageFormats.ICNS, "ICNS Apple Icon Image",
image0.getHeight(), "image/x-icns", images.size(), 0, 0, 0, 0,
image0.getWidth(), false, true, false,
ImageInfo.ColorType.RGB,
ImageInfo.CompressionAlgorithm.UNKNOWN);
}
示例4: getAcceptedTypes
@Override
protected ImageFormat[] getAcceptedTypes() {
return new ImageFormat[] { ImageFormats.ICNS };
}
示例5: isIcns
private static boolean isIcns(final File file) throws IOException,
ImageReadException {
final ImageFormat format = Imaging.guessFormat(file);
return format == ImageFormats.ICNS;
}