当前位置: 首页>>代码示例>>Java>>正文


Java ImageFormats.ICNS属性代码示例

本文整理汇总了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);
}
 
开发者ID:FibreFoX,项目名称:imagetransform-gradle-plugin,代码行数:11,代码来源:ImageFormatRequest.java

示例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);
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:29,代码来源:IcnsImageParser.java

示例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);
}
 
开发者ID:apache,项目名称:commons-imaging,代码行数:28,代码来源:IcnsImageParser.java

示例4: getAcceptedTypes

@Override
protected ImageFormat[] getAcceptedTypes() {
    return new ImageFormat[] { ImageFormats.ICNS };
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:4,代码来源:IcnsImageParser.java

示例5: isIcns

private static boolean isIcns(final File file) throws IOException,
        ImageReadException {
    final ImageFormat format = Imaging.guessFormat(file);
    return format == ImageFormats.ICNS;
}
 
开发者ID:apache,项目名称:commons-imaging,代码行数:5,代码来源:IcnsBaseTest.java


注:本文中的org.apache.commons.imaging.ImageFormats.ICNS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。