本文整理汇总了Java中org.apache.commons.imaging.ImageFormats.PCX属性的典型用法代码示例。如果您正苦于以下问题:Java ImageFormats.PCX属性的具体用法?Java ImageFormats.PCX怎么用?Java ImageFormats.PCX使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.imaging.ImageFormats
的用法示例。
在下文中一共展示了ImageFormats.PCX属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getImageInfo
@Override
public ImageInfo getImageInfo(final ByteSource byteSource, final Map<String, Object> params)
throws ImageReadException, IOException {
final PcxHeader pcxHeader = readPcxHeader(byteSource);
final Dimension size = getImageSize(byteSource, params);
return new ImageInfo(
"PCX",
pcxHeader.nPlanes * pcxHeader.bitsPerPixel,
new ArrayList<String>(),
ImageFormats.PCX,
"ZSoft PCX Image",
size.height,
"image/x-pcx",
1,
pcxHeader.vDpi,
Math.round(size.getHeight() / pcxHeader.vDpi),
pcxHeader.hDpi,
Math.round(size.getWidth() / pcxHeader.hDpi),
size.width,
false,
false,
!(pcxHeader.nPlanes == 3 && pcxHeader.bitsPerPixel == 8),
ImageInfo.COLOR_TYPE_RGB,
pcxHeader.encoding == PcxHeader.ENCODING_RLE ? ImageInfo.COMPRESSION_ALGORITHM_RLE
: ImageInfo.COMPRESSION_ALGORITHM_NONE);
}
示例2: getImageInfo
@Override
public ImageInfo getImageInfo(final ByteSource byteSource, final Map<String, Object> params)
throws ImageReadException, IOException {
final PcxHeader pcxHeader = readPcxHeader(byteSource);
final Dimension size = getImageSize(byteSource, params);
return new ImageInfo(
"PCX",
pcxHeader.nPlanes * pcxHeader.bitsPerPixel,
new ArrayList<String>(),
ImageFormats.PCX,
"ZSoft PCX Image",
size.height,
"image/x-pcx",
1,
pcxHeader.vDpi,
Math.round(size.getHeight() / pcxHeader.vDpi),
pcxHeader.hDpi,
Math.round(size.getWidth() / pcxHeader.hDpi),
size.width,
false,
false,
!(pcxHeader.nPlanes == 3 && pcxHeader.bitsPerPixel == 8),
ImageInfo.ColorType.RGB,
pcxHeader.encoding == PcxHeader.ENCODING_RLE ? ImageInfo.CompressionAlgorithm.RLE
: ImageInfo.CompressionAlgorithm.NONE);
}
示例3: getAcceptedTypes
@Override
protected ImageFormat[] getAcceptedTypes() {
return new ImageFormat[] { ImageFormats.PCX, //
};
}