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


Java IntegerInterleavedRaster.getScanlineStride方法代码示例

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


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

示例1: Int

import sun.awt.image.IntegerInterleavedRaster; //导入方法依赖的package包/类
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:TexturePaintContext.java

示例2: makeRaster

import sun.awt.image.IntegerInterleavedRaster; //导入方法依赖的package包/类
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:TexturePaintContext.java

示例3: Int

import sun.awt.image.IntegerInterleavedRaster; //导入方法依赖的package包/类
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
	   AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:11,代码来源:TexturePaintContext.java

示例4: bufferedToGray

import sun.awt.image.IntegerInterleavedRaster; //导入方法依赖的package包/类
/**
 * A faster convert that works directly with a specific raster
 */
public static void bufferedToGray(IntegerInterleavedRaster src, ImageUInt8 dst) {
	int[] srcData = src.getDataStorage();

	byte[] data = dst.data;

	int srcStride = src.getScanlineStride();
	int srcOffset = src.getDataOffset(0)-src.getPixelStride()+1;
	int srcStrideDiff = srcStride-src.getPixelStride()*dst.width;

	int indexSrc = srcOffset;
	for (int y = 0; y < dst.height; y++) {
		int indexDst = dst.startIndex + y * dst.stride;
		for (int x = 0; x < dst.width; x++) {

			int rgb = srcData[indexSrc++];

			int r = (rgb >>> 16) & 0xFF;
			int g = (rgb >>> 8) & 0xFF;
			int b = rgb & 0xFF;

			int ave = (r + g + b) / 3;

			data[indexDst++] = (byte) ave;
		}
		indexSrc += srcStrideDiff;
	}
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:31,代码来源:ConvertRaster.java

示例5: bufferedToMulti_U8

import sun.awt.image.IntegerInterleavedRaster; //导入方法依赖的package包/类
/**
 * A faster convert that works directly with a specific raster
 */
public static void bufferedToMulti_U8(IntegerInterleavedRaster src, MultiSpectral<ImageUInt8> dst) {
	int[] srcData = src.getDataStorage();

	int srcStride = src.getScanlineStride();
	int srcOffset = src.getDataOffset(0)-src.getPixelStride()+1;
	int srcStrideDiff = srcStride-src.getPixelStride()*dst.width;

	byte[] data1 = dst.getBand(0).data;
	byte[] data2 = dst.getBand(1).data;
	byte[] data3 = dst.getBand(2).data;

	int indexSrc = srcOffset;
	for (int y = 0; y < dst.height; y++) {
		int indexDst = dst.startIndex + y * dst.stride;
		for (int x = 0; x < dst.width; x++, indexDst++) {

			int rgb = srcData[indexSrc++];

			data1[indexDst] = (byte) (rgb >>> 16);
			data2[indexDst] = (byte) (rgb >>> 8);
			data3[indexDst] = (byte) rgb;
		}

		indexSrc += srcStrideDiff;
	}
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:30,代码来源:ConvertRaster.java

示例6: bufferedToMulti_F32

import sun.awt.image.IntegerInterleavedRaster; //导入方法依赖的package包/类
/**
 * A faster convert that works directly with a specific raster
 */
public static void bufferedToMulti_F32(IntegerInterleavedRaster src, MultiSpectral<ImageFloat32> dst) {
	int[] srcData = src.getDataStorage();

	int srcStride = src.getScanlineStride();
	int srcOffset = src.getDataOffset(0)-src.getPixelStride()+1;
	int srcStrideDiff = srcStride-src.getPixelStride()*dst.width;

	float[] data1 = dst.getBand(0).data;
	float[] data2 = dst.getBand(1).data;
	float[] data3 = dst.getBand(2).data;

	int indexSrc = srcOffset;
	for (int y = 0; y < dst.height; y++) {
		int indexDst = dst.startIndex + y * dst.stride;
		for (int x = 0; x < dst.width; x++, indexDst++) {

			int rgb = srcData[indexSrc++];

			data1[indexDst] = (rgb >>> 16) & 0xFF;
			data2[indexDst] = (rgb >>> 8) & 0xFF;
			data3[indexDst] = rgb & 0xFF;
		}

		indexSrc += srcStrideDiff;
	}
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:30,代码来源:ConvertRaster.java


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