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


Java BufferedImage.copyData方法代码示例

本文整理汇总了Java中java.awt.image.BufferedImage.copyData方法的典型用法代码示例。如果您正苦于以下问题:Java BufferedImage.copyData方法的具体用法?Java BufferedImage.copyData怎么用?Java BufferedImage.copyData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.image.BufferedImage的用法示例。


在下文中一共展示了BufferedImage.copyData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: deepCopy

import java.awt.image.BufferedImage; //导入方法依赖的package包/类
/**
 * Make a copy of the {@code BufferedImage} object.
 * @param image the provided image.
 * @return copy of the provided image.
 */
static BufferedImage deepCopy( BufferedImage image ) {
    ColorModel cm = image.getColorModel();
    boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
    WritableRaster raster = image.copyData( null);
    return new BufferedImage( cm, raster, isAlphaPremultiplied, null);
}
 
开发者ID:romankh3,项目名称:image-comparison,代码行数:12,代码来源:ImageComparisonTools.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

示例4: copyImage

import java.awt.image.BufferedImage; //导入方法依赖的package包/类
/**
 * Convenience method for copying an image without passing in an image to
 * copy to.
 * 
 * @param source the image to copy
 * @return the copied image
 */
public static BufferedImage copyImage(final Image source) {

	if (source instanceof BufferedImage) {
		BufferedImage bi = ((BufferedImage)source);
		if (BufferedImage.TYPE_INT_RGB == bi.getType()) {	
			ColorModel cm = bi.getColorModel();
			return new BufferedImage(cm, bi.copyData(null), cm.isAlphaPremultiplied(), null);	
		}
	}
	BufferedImage copy = new BufferedImage(source.getWidth(null), source.getHeight(null), BufferedImage.TYPE_INT_RGB);
	copyImage(source, copy);
	return copy;
}
 
开发者ID:KodeMunkie,项目名称:imagetozxspec,代码行数:21,代码来源:ImageHelper.java

示例5: deepCopy

import java.awt.image.BufferedImage; //导入方法依赖的package包/类
private static BufferedImage deepCopy(BufferedImage bi)
{
    ColorModel cm = bi.getColorModel();
    boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
    WritableRaster raster = bi.copyData(null);
    return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
}
 
开发者ID:mirkoruether,项目名称:DigitRecognizer,代码行数:8,代码来源:DigitManipulator.java

示例6: deepCopy

import java.awt.image.BufferedImage; //导入方法依赖的package包/类
private static BufferedImage deepCopy(BufferedImage bi) {
    ColorModel cm = bi.getColorModel();
    boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
    WritableRaster raster = bi.copyData(null);
    return new BufferedImage(cm, raster, isAlphaPremultiplied, null)
            .getSubimage(0, 0, bi.getWidth(), bi.getHeight());
}
 
开发者ID:tomwhite,项目名称:set-game,代码行数:8,代码来源:PlaySet.java

示例7: deepCopy

import java.awt.image.BufferedImage; //导入方法依赖的package包/类
/**
 * Create a duplicate of a BufferedImage.
 * @param bi
 * @return the copied image.
 */
private static BufferedImage deepCopy(BufferedImage bi) {
	 ColorModel cm = bi.getColorModel();
	 boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
	 WritableRaster raster = bi.copyData(null);
	 return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:MMapServer.java

示例8: deepCopy

import java.awt.image.BufferedImage; //导入方法依赖的package包/类
public static BufferedImage deepCopy(BufferedImage img) {
	ColorModel cm = img.getColorModel();
	boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
	WritableRaster raster = img.copyData(null);
	return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
}
 
开发者ID:CalebKussmaul,项目名称:GIFKR,代码行数:7,代码来源:ImageTools.java

示例9: deepCopy

import java.awt.image.BufferedImage; //导入方法依赖的package包/类
static BufferedImage deepCopy(BufferedImage bi) {
	 ColorModel cm = bi.getColorModel();
	 boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
	 WritableRaster raster = bi.copyData(null);
	 return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:7,代码来源:NonGLImageDisplay.java


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