public class Raster extends Object
光栅定义占据一个特定的平面区域的像素的值,不一定包括(0,0)。长方形,称为光栅的边框由getBounds方法可用,是丫头,miny,宽度和高度值的定义。minx,miny值定义的栅格的左上角的坐标。在边框外像素引用可能导致一个异常被抛出,或可能导致对光栅的DataBuffer意外的元素的引用。避免访问这样的像素是用户的责任。
SampleModel描述了一个光栅样品存放在一个数组中的元素的原始数据缓冲区。样品可以存储每一个数据元素,如在pixelinterleavedsamplemodel或bandedsamplemodel,或包装的几个因素,如在singlepixelpackedsamplemodel或multipixelpackedsamplemodel。的samplemodel也控制是否样品进行符号扩展,允许未签名的数据被存储在签署了java数据类型如字节,短,和int。
虽然光栅可以生活在平面上的任何地方,一个samplemodel利用一个简单的坐标系,从(0,0)。光栅因此包含一个转录因子,使像素的位置是栅格的坐标系统之间的samplemodel映射。从samplemodel坐标系统,光栅的翻译可以由getsamplemodeltranslatex和getsamplemodeltranslatey方法获得。
光栅可以共享一个数据缓存是通过显式的建筑或另一个栅格所使用的CreateChild和createtranslatedchild方法。通过这些方法产生的光栅可以返回一个引用到栅格被创造的getParent方法。一种光栅,并不是由一个叫createtranslatedchild或CreateChild构造getParent将返回null。
的createtranslatedchild方法返回一个新的栅格,股份所有当前栅格数据,但占据包围矩形的宽度和高度相同但不同的起点。例如,如果母光栅占据的区域(10,10)到(100,100),和翻译的栅格定义开始在(50,50),然后像素(20,20)的家长和像素(60,60)的孩子占据两光栅的共享数据的缓存位置相同。在第一种情况下,(10,10)应该被添加到一个像素的坐标来获得相应的samplemodel坐标,并在第二种情况下(50,50)应增加。
翻译:父母和孩子之间的光栅可以通过与该母减去孩子的samplemodeltranslatex和samplemodeltranslatey值确定。
的CreateChild方法可用于创建一个新的栅格占用的一个子集,其母的矩形(同或转换坐标系)或与其母带的子集。
所有的构造函数都被保护。创建一个栅格的正确方法是使用在这个类中定义的静态创建方法之一。这些方法创建栅格,使用标准的情况下,交叉的,带状的,和Packed SampleModels,可以处理比光栅结合外部生成的SampleModel和DataBuffer创造了更有效。
Modifier and Type | Field and Description |
---|---|
protected DataBuffer |
dataBuffer
存储图像数据的缓冲。
|
protected int |
height
这个光栅的高度。
|
protected int |
minX
该光栅的左上角的X坐标。
|
protected int |
minY
该光栅的左上角的Y坐标。
|
protected int |
numBands
光栅中的条带数。
|
protected int |
numDataElements
每个像素的数据缓冲区的数据元素个数。
|
protected Raster |
parent
这个光栅的父或空。
|
protected SampleModel |
sampleModel
的samplemodel描述像素从这个栅格存储在DataBuffer。
|
protected int |
sampleModelTranslateX
X翻译从光栅的SampleModel坐标空间到栅格。
|
protected int |
sampleModelTranslateY
从光栅的SampleModel坐标空间,栅格Y翻译。
|
protected int |
width
这个光栅的宽度。
|
Modifier | Constructor and Description |
---|---|
protected |
Raster(SampleModel sampleModel, DataBuffer dataBuffer, Point origin)
构建一个与给定的samplemodel和DataBuffer光栅。
|
protected |
Raster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, Raster parent)
构建了一个栅格与给定的samplemodel,DataBuffer,和父母。
|
protected |
Raster(SampleModel sampleModel, Point origin)
构建一个与给定的SampleModel光栅。
|
Modifier and Type | Method and Description |
---|---|
static WritableRaster |
createBandedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int[] bankIndices, int[] bandOffsets, Point location)
创建一个栅格的基础上bandedsamplemodel与指定DataBuffer、宽度、高度、扫描线的步伐,银行指数,和带偏移。
|
static WritableRaster |
createBandedRaster(int dataType, int w, int h, int scanlineStride, int[] bankIndices, int[] bandOffsets, Point location)
创建一个栅格的基础上bandedsamplemodel与指定的数据类型、宽度、高度、扫描线的步伐,银行指数和带偏移。
|
static WritableRaster |
createBandedRaster(int dataType, int w, int h, int bands, Point location)
创建一个栅格的基础上bandedsamplemodel与指定的数据类型,宽度,高度,和一些带。
|
Raster |
createChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)
返回一个新的栅格的股份全部或部分该光栅的DataBuffer。
|
WritableRaster |
createCompatibleWritableRaster()
创建一个兼容的writableraster大小这个栅格同SampleModel和DataBuffer一样的一个新的初始化。
|
WritableRaster |
createCompatibleWritableRaster(int w, int h)
创建一个指定大小的兼容writableraster,新samplemodel,和创建一个新的DataBuffer。
|
WritableRaster |
createCompatibleWritableRaster(int x, int y, int w, int h)
创建一个指定位置兼容writableraster(丫头,miny)和尺寸(宽度,高度),一个新的samplemodel,并创建一个新的DataBuffer。
|
WritableRaster |
createCompatibleWritableRaster(Rectangle rect)
创建一个定位兼容writableraster(丫头,miny)和尺寸(宽度,高度)指定的矩形,一个新的samplemodel,并创建一个新的DataBuffer。
|
static WritableRaster |
createInterleavedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int pixelStride, int[] bandOffsets, Point location)
创建一个栅格的基础上pixelinterleavedsamplemodel与指定DataBuffer、宽度、高度、线大步,像素的步伐,和带偏移。
|
static WritableRaster |
createInterleavedRaster(int dataType, int w, int h, int scanlineStride, int pixelStride, int[] bandOffsets, Point location)
创建一个栅格的基础上pixelinterleavedsamplemodel与指定的数据类型、宽度、高度、线大步,像素的步伐,和带偏移。
|
static WritableRaster |
createInterleavedRaster(int dataType, int w, int h, int bands, Point location)
创建一个栅格的基础上pixelinterleavedsamplemodel与指定的数据类型,宽度,高度,和一些带。
|
static WritableRaster |
createPackedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int[] bandMasks, Point location)
创建一个栅格的基础上singlepixelpackedsamplemodel与指定DataBuffer、宽度、高度、扫描线的步伐,和带口罩。
|
static WritableRaster |
createPackedRaster(DataBuffer dataBuffer, int w, int h, int bitsPerPixel, Point location)
创建一个栅格的基础上multipixelpackedsamplemodel与指定的DataBuffer,宽度,高度,和每像素的位数。
|
static WritableRaster |
createPackedRaster(int dataType, int w, int h, int[] bandMasks, Point location)
创建一个栅格的基础上singlepixelpackedsamplemodel与指定的数据类型,宽度,高度,和带口罩。
|
static WritableRaster |
createPackedRaster(int dataType, int w, int h, int bands, int bitsPerBand, Point location)
创建一个栅格在一个拥挤的samplemodel与指定的数据类型、宽度、高度、带数量,和比特/带。
|
static Raster |
createRaster(SampleModel sm, DataBuffer db, Point location)
创建一个具有指定samplemodel和DataBuffer光栅。
|
Raster |
createTranslatedChild(int childMinX, int childMinY)
创建一个具有相同尺寸的光栅,SampleModel和DataBuffer的这一个,但不同的位置。
|
static WritableRaster |
createWritableRaster(SampleModel sm, DataBuffer db, Point location)
创建一个具有指定samplemodel和DataBuffer writableraster。
|
static WritableRaster |
createWritableRaster(SampleModel sm, Point location)
创建一个具有指定SampleModel writableraster。
|
Rectangle |
getBounds()
返回此光栅的包围矩形。
|
DataBuffer |
getDataBuffer()
返回与此有关的DataBuffer光栅。
|
Object |
getDataElements(int x, int y, int w, int h, Object outData)
返回指定的矩形中的像素阵列式transfertype像素数据。
|
Object |
getDataElements(int x, int y, Object outData)
返回在一个原始的数组类型transfertype单个像素数据。
|
int |
getHeight()
返回光栅的像素的高度。
|
int |
getMinX()
返回光栅的最小有效x坐标。
|
int |
getMinY()
返回光栅的最小有效Y坐标。
|
int |
getNumBands()
返回这个光栅中的每个像素的带数(样本数)。
|
int |
getNumDataElements()
返回的数据元素需要传递一个像素数通过getdataelements和setdataelements方法。
|
Raster |
getParent()
返回此光栅或零的父光栅(如果有的话)。
|
double[] |
getPixel(int x, int y, double[] dArray)
返回指定像素的数组中的样本。
|
float[] |
getPixel(int x, int y, float[] fArray)
返回指定像素的浮点数组中的样本。
|
int[] |
getPixel(int x, int y, int[] iArray)
返回在指定的像素一个int数组的样品。
|
double[] |
getPixels(int x, int y, int w, int h, double[] dArray)
返回一个包含一个像素矩形的双数组,一个每个数组元素的样本。
|
float[] |
getPixels(int x, int y, int w, int h, float[] fArray)
返回一个包含一个像素矩形的所有样本的浮点数组,每个数组元素的一个样本。
|
int[] |
getPixels(int x, int y, int w, int h, int[] iArray)
返回包含一个矩形的像素样本一个int数组,每个数组元素的一个样本。
|
int |
getSample(int x, int y, int b)
返回像素位于指定带样品(x,y)为int型。
|
double |
getSampleDouble(int x, int y, int b)
返回位于(X,Y)为双的像素指定的带中的样本。
|
float |
getSampleFloat(int x, int y, int b)
返回位于(X,Y)作为一个浮动的像素指定的带中的样本。
|
SampleModel |
getSampleModel()
返回samplemodel描述图像数据的布局。
|
int |
getSampleModelTranslateX()
返回x翻译的samplemodel坐标系统的栅格。
|
int |
getSampleModelTranslateY()
返回的samplemodel坐标系统的栅格Y翻译。
|
double[] |
getSamples(int x, int y, int w, int h, int b, double[] dArray)
返回一个指定的带指定的矩形的像素在一个双数组,一个样本每一个数组元素的样本。
|
float[] |
getSamples(int x, int y, int w, int h, int b, float[] fArray)
返回浮点数组中指定的矩形像素的指定带的样本,每个数组元素的一个示例。
|
int[] |
getSamples(int x, int y, int w, int h, int b, int[] iArray)
返回在指定的矩形的像素在一个int数组指定带样品,每一样品的数组元素。
|
int |
getTransferType()
返回用于传输像素通过getdataelements和setdataelements方法transfertype。
|
int |
getWidth()
返回光栅的像素的宽度。
|
protected SampleModel sampleModel
protected DataBuffer dataBuffer
protected int minX
protected int minY
protected int width
protected int height
protected int sampleModelTranslateX
protected int sampleModelTranslateY
protected int numBands
protected int numDataElements
protected Raster parent
protected Raster(SampleModel sampleModel, Point origin)
sampleModel
- samplemodel指定布局
origin
-指定的起点
RasterFormatException
-如果在整数溢出计算
origin.x + sampleModel.getWidth()
或
origin.y + sampleModel.getHeight()
结果
NullPointerException
-
sampleModel
或
origin
是空的
protected Raster(SampleModel sampleModel, DataBuffer dataBuffer, Point origin)
sampleModel
- samplemodel指定布局
dataBuffer
-包含图像数据的数据缓冲区
origin
-点指定的起源
RasterFormatException
-如果在整数溢出计算
origin.x + sampleModel.getWidth()
或
origin.y + sampleModel.getHeight()
结果
NullPointerException
-
sampleModel
或
origin
是空的
protected Raster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, Raster parent)
sampleModel
- samplemodel指定布局
dataBuffer
-包含图像数据的数据缓冲区
aRegion
-矩形指定图像区域
sampleModelTranslate
-点指定的翻译从SampleModel到栅格坐标
parent
-母(如果有)这个栅格
NullPointerException
-如果
sampleModel
,
dataBuffer
,
aRegion
或
sampleModelTranslate
是空的
RasterFormatException
aRegion
宽度或高度小于或等于零,或整数溢出计算
aRegion.x + aRegion.width
或
aRegion.y + aRegion.height
结果
public static WritableRaster createInterleavedRaster(int dataType, int w, int h, int bands, Point location)
光栅的左上角由位置参数给出。如果位置是空的,(0,0)将被使用。数据类型参数应该是一个在数据缓存类定义的枚举值。
注意:不支持DataBuffer.TYPE_INT
栅格交错。创建一个类型DataBuffer.TYPE_INT
,使用栅格1-band createpackedraster()栅格。
唯一支持的数据类型是目前type_byte和type_ushort。
dataType
-样品的存储的数据类型
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
bands
-带的数量
location
-左上角的
Raster
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
public static WritableRaster createInterleavedRaster(int dataType, int w, int h, int scanlineStride, int pixelStride, int[] bandOffsets, Point location)
光栅的左上角由位置参数给出。如果位置是空的,(0,0)将被使用。数据类型参数应该是一个在数据缓存类定义的枚举值。
注意:不支持DataBuffer.TYPE_INT
栅格交错。创建一个类型DataBuffer.TYPE_INT
,使用栅格1-band createpackedraster()栅格。
唯一支持的数据类型是目前type_byte和type_ushort。
dataType
-样品的存储的数据类型
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
scanlineStride
-图像数据线步
pixelStride
-图像数据的像素跨度
bandOffsets
-所有带偏移
location
-左上角的
Raster
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
IllegalArgumentException
-如果
dataType
是不受支持的数据类型,这是
DataBuffer.TYPE_BYTE
,或
DataBuffer.TYPE_USHORT
。
public static WritableRaster createBandedRaster(int dataType, int w, int h, int bands, Point location)
光栅的左上角由位置参数给出。如果位置是空的,(0,0)将被使用。数据类型参数应该是一个在数据缓存类定义的枚举值。
唯一支持的数据类型是目前type_byte,type_ushort,和type_int。
dataType
-样品的存储的数据类型
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
bands
-带的数量
location
-左上角的
Raster
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
ArrayIndexOutOfBoundsException
-如果
bands
小于1
public static WritableRaster createBandedRaster(int dataType, int w, int h, int scanlineStride, int[] bankIndices, int[] bandOffsets, Point location)
光栅的左上角由位置参数给出。数据类型参数应该是一个在数据缓存类定义的枚举值。
唯一支持的数据类型是目前type_byte,type_ushort,和type_int。
dataType
-样品的存储的数据类型
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
scanlineStride
-图像数据线步
bankIndices
-每个波段的银行指数
bandOffsets
-所有带偏移
location
-左上角的
Raster
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
IllegalArgumentException
-如果
dataType
是不受支持的数据类型,这是
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
或
DataBuffer.TYPE_INT
ArrayIndexOutOfBoundsException
-如果
bankIndices
或
bandOffsets
是
null
public static WritableRaster createPackedRaster(int dataType, int w, int h, int[] bandMasks, Point location)
光栅的左上角由位置参数给出。如果位置是空的,(0,0)将被使用。数据类型参数应该是一个在数据缓存类定义的枚举值。
唯一支持的数据类型是目前type_byte,type_ushort,和type_int。
dataType
-样品的存储的数据类型
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
bandMasks
-数组中的每个波段的入口
location
-左上角的
Raster
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
IllegalArgumentException
-如果
dataType
是不受支持的数据类型,这是
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
或
DataBuffer.TYPE_INT
public static WritableRaster createPackedRaster(int dataType, int w, int h, int bands, int bitsPerBand, Point location)
如果带的数量超过一个,SampleModel将是一个singlepixelpackedsamplemodel,每个波段有bitsperband位。在任何情况下,对相应的samplemodel强加的数据类型和bitsperband必须满足要求。
光栅的左上角由位置参数给出。如果位置是空的,(0,0)将被使用。数据类型参数应该是一个在数据缓存类定义的枚举值。
唯一支持的数据类型是目前type_byte,type_ushort,和type_int。
dataType
-样品的存储的数据类型
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
bands
-带的数量
bitsPerBand
-比特每带数
location
-左上角的
Raster
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
IllegalArgumentException
-如果
bitsPerBand
和
bands
产品大于
dataType
持有的比特数
IllegalArgumentException
-如果
bitsPerBand
或
bands
不大于零
IllegalArgumentException
-如果
dataType
是不受支持的数据类型,这是
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
或
DataBuffer.TYPE_INT
public static WritableRaster createInterleavedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int pixelStride, int[] bandOffsets, Point location)
注意:不支持DataBuffer.TYPE_INT
栅格交错。创建一个类型DataBuffer.TYPE_INT
,使用栅格1-band createpackedraster()栅格。
dataBuffer
-包含图像数据的
DataBuffer
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
scanlineStride
-图像数据线步
pixelStride
-图像数据的像素跨度
bandOffsets
-所有带偏移
location
-左上角的
Raster
DataBuffer
,writableraster对象的宽度、高度、扫描线的步幅,步幅和带偏移的像素。
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
IllegalArgumentException
-如果
dataType
是不受支持的数据类型,这是
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
RasterFormatException
-如果有一个以上的银行
dataBuffer
。
NullPointerException
-如果
dataBuffer
是空的
public static WritableRaster createBandedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int[] bankIndices, int[] bandOffsets, Point location)
dataBuffer
-包含图像数据的
DataBuffer
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
scanlineStride
-图像数据线步
bankIndices
-每个波段的银行指数
bandOffsets
-所有带偏移
location
-左上角的
Raster
DataBuffer
,writableraster对象的宽度、高度、扫描线的步伐,银行指数和带偏移。
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
IllegalArgumentException
-如果
dataType
是不受支持的数据类型,这是
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
或
DataBuffer.TYPE_INT
NullPointerException
-如果
dataBuffer
是空的
public static WritableRaster createPackedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int[] bandMasks, Point location)
dataBuffer
-包含图像数据的
DataBuffer
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
scanlineStride
-图像数据线步
bandMasks
-数组中的每个波段的入口
location
-左上角的
Raster
DataBuffer
,writableraster对象的宽度、高度、扫描线的步伐,和带口罩。
RasterFormatException
-如果
w
或
h
小于或等于零,或计算结果
location.x + w
或
location.y + h
整数溢出
IllegalArgumentException
-如果
dataType
是不受支持的数据类型,这是
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
或
DataBuffer.TYPE_INT
RasterFormatException
-如果有一个以上的银行
dataBuffer
。
NullPointerException
-如果
dataBuffer
是空的
public static WritableRaster createPackedRaster(DataBuffer dataBuffer, int w, int h, int bitsPerPixel, Point location)
dataBuffer
-包含图像数据的
DataBuffer
w
-在图像数据的像素宽度
h
-在图像数据的像素高度
bitsPerPixel
-每个像素的比特数
location
-左上角的
Raster
DataBuffer
,writableraster对象的宽度,高度,和每像素的位数。
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
location.x + w
或
location.y + h
结果
IllegalArgumentException
-如果
dataType
是不受支持的数据类型,这是
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
或
DataBuffer.TYPE_INT
RasterFormatException
-如果有一个以上的银行
dataBuffer
。
NullPointerException
-如果
dataBuffer
是空的
public static Raster createRaster(SampleModel sm, DataBuffer db, Point location)
sm
-指定
SampleModel
db
-指定
DataBuffer
location
-左上角的
Raster
Raster
与指定的
SampleModel
,
DataBuffer
,和位置。
RasterFormatException
-如果在整数溢出计算
location.x + sm.getWidth()
或
location.y + sm.getHeight()
结果
RasterFormatException
-如果
db
有多个银行和
sm
是PixelInterleavedSampleModel,singlepixelpackedsamplemodel,或multipixelpackedsamplemodel。
NullPointerException
-如果SampleModel或DataBuffer是空的
public static WritableRaster createWritableRaster(SampleModel sm, Point location)
sm
-指定
SampleModel
location
-左上角的
WritableRaster
SampleModel
和位置
WritableRaster
。
RasterFormatException
-如果在整数溢出计算
location.x + sm.getWidth()
或
location.y + sm.getHeight()
结果
public static WritableRaster createWritableRaster(SampleModel sm, DataBuffer db, Point location)
sm
-指定
SampleModel
db
-指定
DataBuffer
location
-左上角的
WritableRaster
WritableRaster
与指定的
SampleModel
,
DataBuffer
,和位置。
RasterFormatException
-如果在整数溢出计算
location.x + sm.getWidth()
或
location.y + sm.getHeight()
结果
RasterFormatException
-如果
db
有多个银行和
sm
是PixelInterleavedSampleModel,singlepixelpackedsamplemodel,或multipixelpackedsamplemodel。
NullPointerException
-如果SampleModel或DataBuffer是空的
public Raster getParent()
null
。
public final int getSampleModelTranslateX()
public final int getSampleModelTranslateY()
public WritableRaster createCompatibleWritableRaster()
WritableRaster
同样本模型和新的数据缓冲区。
public WritableRaster createCompatibleWritableRaster(int w, int h)
w
-指定宽度的新
WritableRaster
h
-指定高度的新
WritableRaster
WritableRaster
用指定的大小和一个新的样本模型和数据缓冲区。
RasterFormatException
如果宽度或高度小于或等于零。
public WritableRaster createCompatibleWritableRaster(Rectangle rect)
rect
-
Rectangle
指定大小和位置的
WritableRaster
WritableRaster
与指定的大小和位置,和一个新的样本模型和数据缓冲区。
RasterFormatException
rect
宽度或高度小于或等于零,或整数溢出计算
rect.x + rect.width
或
rect.y + rect.height
结果
NullPointerException
-如果
rect
是空的
public WritableRaster createCompatibleWritableRaster(int x, int y, int w, int h)
x
的
WritableRaster
左上角的x坐标
y
-
WritableRaster
的左上角的Y坐标
w
-指定宽度的
WritableRaster
h
-指定高度的
WritableRaster
WritableRaster
与指定的大小和位置,和一个新的样本模型和数据缓冲区。
RasterFormatException
-如果
w
或
h
小于或等于零,或整数溢出计算
x + w
或
y + h
结果
public Raster createTranslatedChild(int childMinX, int childMinY)
childMinX
-新的
Raster
左上角的x坐标
childMinY
-新的
Raster
左上角的Y坐标
Raster
具有相同的大小,SampleModel,和DataBuffer这样
Raster
,但指定的位置。
RasterFormatException
-如果在整数溢出计算
childMinX + this.getWidth()
或
childMinY + this.getHeight()
结果
public Raster createChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)
parentx保的,宽度和高度参数的形式在这个栅格的坐标空间的一个矩形,表示要共享像素面积。如果这个矩形不包含当前光栅的边界,将引发一个错误。
新的光栅可以被转换到一个不同的坐标系统的平面比目前的光栅所使用的。的childminx和childminy参数给新(x,y)后的栅格左上像素点的坐标;坐标(childminx,childminy)在新的栅格将映射到相同的像素的坐标(parentx,保)在当前栅格。
该光栅可以被定义为只包含一个子集的当前栅格,乐队可能重组,通过对bandlist参数。如果bandlist是空的,它被包括在目前的订单所有当前栅格波段。
创建一个包含一个分区当前栅格新光栅,但股价的坐标系统和带,这种方法应该被称为childminx等于parentx,childminy等于保和bandlist等于零。
parentX
的x坐标的左上角,在这个栅格坐标
parentY
栅格的坐标,左上角的y坐标
width
开始在区域的宽度(parentx,保)
height
高度的区域开始(parentx,保)。
childMinX
-后的栅格的左上角的x坐标
childMinY
-后的栅格的左上角的Y坐标
bandList
-带指数阵列,或使用带空
Raster
。
RasterFormatException
-如果指定区域的栅格界限之外。
RasterFormatException
-如果
width
或
height
小于或等于零,或计算任何
parentX + width
,
parentY + height
,
childMinX + width
,或
childMinY + height
结果整数溢出
public Rectangle getBounds()
Raster
包围盒。
public final int getMinX()
Raster
。
public final int getMinY()
Raster
最小y坐标。
public final int getWidth()
Raster
宽度。
public final int getHeight()
Raster
高度。
public final int getNumBands()
Raster
带数。
public final int getNumDataElements()
public final int getTransferType()
public DataBuffer getDataBuffer()
Raster
的
DataBuffer
。
public SampleModel getSampleModel()
Raster
的
SampleModel
。
public Object getDataElements(int x, int y, Object outData)
x
的像素位置的x坐标
y
的像素位置的y坐标
outData
-一个对象的引用数组的类型定义的gettransfertype()和长度getnumdataelements()。如果为空,将分配一个适当类型和大小的数组
ArrayIndexOutOfBoundsException
如果坐标不会越界,或者如果数据太小装的输出。
SampleModel.getDataElements(int, int, Object, DataBuffer)
public Object getDataElements(int x, int y, int w, int h, Object outData)
x
-左上角像素位置的x坐标
y
-左上角像素位置的y坐标
w
-像素矩形的宽度
h
-像素矩形的高度
outData
-一个对象的引用数组的类型定义的gettransfertype()和长宽*高* getnumdataelements()。如果为空,将分配一个适当类型和大小的数组。
ArrayIndexOutOfBoundsException
如果坐标不会越界,或者如果数据太小装的输出。
SampleModel.getDataElements(int, int, int, int, Object, DataBuffer)
public int[] getPixel(int x, int y, int[] iArray)
x
的像素位置的x坐标
y
的像素位置的y坐标
iArray
-可选的预分配数组
ArrayIndexOutOfBoundsException
如果坐标不会越界,或者如果iarray太小装的输出。
public float[] getPixel(int x, int y, float[] fArray)
x
的像素位置的x坐标
y
的像素位置的y坐标
fArray
-可选的预分配的浮点数组
ArrayIndexOutOfBoundsException
如果坐标不会越界,或者如果farray太小装的输出。
public double[] getPixel(int x, int y, double[] dArray)
x
的像素位置的x坐标
y
的像素位置的y坐标
dArray
-可选的预分配双数组
ArrayIndexOutOfBoundsException
如果坐标不会越界,或者如果darray太小装的输出。
public int[] getPixels(int x, int y, int w, int h, int[] iArray)
x
-左上角像素位置的x坐标
y
-左上角像素位置的y坐标
w
-像素矩形的宽度
h
-像素矩形的高度
iArray
-可选的预分配的数组
ArrayIndexOutOfBoundsException
如果坐标不会越界,或者如果iarray太小装的输出。
public float[] getPixels(int x, int y, int w, int h, float[] fArray)
x
的像素位置的x坐标
y
的像素位置的y坐标
w
-像素矩形的宽度
h
-像素矩形的高度
fArray
-可选的预分配的浮点数组
ArrayIndexOutOfBoundsException
如果坐标不会越界,或者如果farray太小装的输出。
public double[] getPixels(int x, int y, int w, int h, double[] dArray)
x
-左上角像素位置的x坐标
y
-左上角像素位置的y坐标
w
-像素矩形的宽度
h
-像素矩形的高度
dArray
-可选的预分配的双数组
ArrayIndexOutOfBoundsException
如果坐标不会越界,或者如果darray太小装的输出。
public int getSample(int x, int y, int b)
x
的像素位置的x坐标
y
的像素位置的y坐标
b
-带回来
ArrayIndexOutOfBoundsException
-如果坐标或波段指数没有界限。
public float getSampleFloat(int x, int y, int b)
x
的像素位置的x坐标
y
的像素位置的y坐标
b
-带回来
ArrayIndexOutOfBoundsException
-如果坐标或波段指数没有界限。
public double getSampleDouble(int x, int y, int b)
x
的像素位置的x坐标
y
的像素位置的y坐标
b
-带回来
ArrayIndexOutOfBoundsException
-如果坐标或波段指数没有界限。
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray)
x
-左上角像素位置的x坐标
y
-左上角像素位置的y坐标
w
-像素矩形的宽度
h
-像素矩形的高度
b
-带回来
iArray
-可选的预分配的数组
ArrayIndexOutOfBoundsException
-如果坐标或波段指数不越界,或者如果iarray太小装的输出。
public float[] getSamples(int x, int y, int w, int h, int b, float[] fArray)
x
-左上角像素位置的x坐标
y
-左上角像素位置的y坐标
w
-像素矩形的宽度
h
-像素矩形的高度
b
-带回来
fArray
-可选的预分配的浮点数组
ArrayIndexOutOfBoundsException
-如果坐标或波段指数不越界,或者如果farray太小装的输出。
public double[] getSamples(int x, int y, int w, int h, int b, double[] dArray)
x
-左上角像素位置的x坐标
y
-左上角像素位置的y坐标
w
-像素矩形的宽度
h
-像素矩形的高度
b
-带回来
dArray
-可选的预分配的双数组
ArrayIndexOutOfBoundsException
-如果坐标或波段指数不越界,或者如果darray太小装的输出。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.