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


Java BufferedImage.isAlphaPremultiplied方法代码示例

本文整理汇总了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
  );
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:30,代码来源:GeneralFilter.java

示例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;
}
 
开发者ID:varunon9,项目名称:Image-Stegano,代码行数:15,代码来源:ImageUtility.java

示例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;
    }
}
 
开发者ID:varunon9,项目名称:Image-Stegano,代码行数:14,代码来源:ColourMap.java


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