本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}