本文整理汇总了Java中java.awt.image.BufferedImage.isAlphaPremultiplied方法的典型用法代码示例。如果您正苦于以下问题:Java BufferedImage.isAlphaPremultiplied方法的具体用法?Java BufferedImage.isAlphaPremultiplied怎么用?Java BufferedImage.isAlphaPremultiplied使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.image.BufferedImage
的用法示例。
在下文中一共展示了BufferedImage.isAlphaPremultiplied方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: zoom
import java.awt.image.BufferedImage; //导入方法依赖的package包/类
/**
* Filters the entire source image.
*
* This is a convenience function which calls
* {@link zoom(WritableRaster, Rectangle, BufferedImage, Filter)},
* setting the destination rectangle as the bounds of the destination
* tile.
*
* @param dst the destination rectangle
* @param src the soure image
* @param filter the filter to apply
* @throws ClassCastException if <code>src</code> does not store its data
* in a {@link DataBufferInt}
*/
public static BufferedImage zoom(
Rectangle dst, BufferedImage src, final Filter filter) {
final WritableRaster dstR =
src.getColorModel().createCompatibleWritableRaster(dst.width, dst.height);
zoom(dstR, dstR.getBounds(), src, filter);
// FIXME: check whether this affects hardware acceleration
return new BufferedImage(
src.getColorModel(),
dstR,
src.isAlphaPremultiplied(),
null
);
}
示例2: copyImage
import java.awt.image.BufferedImage; //导入方法依赖的package包/类
/**
* we don't want to alter original image (actually converted image)
* since we need this each time for reference
* @param coverImage original carrier/cover image
* @return a copy of supplied image
*/
public BufferedImage copyImage(BufferedImage coverImage) {
ColorModel colorModel = coverImage.getColorModel();
boolean isAlphaPremultiplied = coverImage.isAlphaPremultiplied();
WritableRaster raster = coverImage.copyData(null);
BufferedImage newImage = new BufferedImage(colorModel, raster,
isAlphaPremultiplied, null);
return newImage;
}
示例3: changeColourMap
import java.awt.image.BufferedImage; //导入方法依赖的package包/类
public BufferedImage changeColourMap(BufferedImage userSpaceImage,
IndexColorModel customIndexColorModel) {
ColorModel originalCM = userSpaceImage.getColorModel();
if (originalCM instanceof IndexColorModel) {
boolean isAlphaPremultiplied = userSpaceImage.isAlphaPremultiplied();
WritableRaster raster = userSpaceImage.copyData(null);
BufferedImage newImage = new BufferedImage(customIndexColorModel,
raster, isAlphaPremultiplied, null);
return newImage;
} else {
return null;
}
}