java raster_Raster
方法詳細(xì)信息
createInterleavedRaster public static?WritableRaster?createInterleavedRaster?(int?dataType,
int?w,
int?h,
int?bands,
Point?location)
基于PixelInterleavedSampleModel創(chuàng)建一個Raster,其中包含指定的數(shù)據(jù)類型,寬度,高度和band數(shù)。
Raster的左上角由location參數(shù)給出。 如果location為null,將使用(0,0)。 dataType參數(shù)應(yīng)該是DataBuffer類中定義的枚舉值之一。
請注意,不支持交錯DataBuffer.TYPE_INT柵格。 要創(chuàng)建類型為DataBuffer.TYPE_INT的1波段光柵,請使用Raster.createPackedRaster()。
目前支持的唯一數(shù)據(jù)類型是TYPE_BYTE和TYPE_USHORT。
參數(shù)
dataType - 用于存儲樣本的數(shù)據(jù)類型
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的像素高度
bands - 頻段數(shù)
location -
Raster
結(jié)果
具有指定數(shù)據(jù)類型,寬度,高度和波段數(shù)的WritableRaster對象。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
createInterleavedRaster public static?WritableRaster?createInterleavedRaster?(int?dataType,
int?w,
int?h,
int?scanlineStride,
int?pixelStride,
int[]?bandOffsets,
Point?location)
基于PixelInterleavedSampleModel創(chuàng)建一個Raster,其中包含指定的數(shù)據(jù)類型,寬度,高度,掃描行間距,像素跨度和波段偏移。
band的數(shù)量是從bandOffsets.length推斷出來的。
Raster的左上角由location參數(shù)給出。 如果location為null,將使用(0,0)。 dataType參數(shù)應(yīng)該是DataBuffer類中定義的枚舉值之一。
請注意,不支持交錯DataBuffer.TYPE_INT柵格。 要創(chuàng)建類型為DataBuffer.TYPE_INT的1波段光柵,請使用Raster.createPackedRaster()。
目前支持的唯一數(shù)據(jù)類型是TYPE_BYTE和TYPE_USHORT。
參數(shù)
dataType - 用于存儲樣本的數(shù)據(jù)類型
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
scanlineStride - 圖像數(shù)據(jù)的行
scanlineStride
pixelStride - 圖像數(shù)據(jù)的像素跨度
bandOffsets - 所有樂隊的抵消
location -
Raster
結(jié)果
一個WritableRaster對象,具有指定的數(shù)據(jù)類型,寬度,高度,掃描行間距,像素跨度和帶偏移。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
dataType不是受支持的數(shù)據(jù)類型之一,即
DataBuffer.TYPE_BYTE或
DataBuffer.TYPE_USHORT 。
createBandedRaster public static?WritableRaster?createBandedRaster?(int?dataType,
int?w,
int?h,
int?bands,
Point?location)
基于BandedSampleModel創(chuàng)建一個Raster,其中包含指定的數(shù)據(jù)類型,寬度,高度和band數(shù)。
Raster的左上角由location參數(shù)給出。 如果location為null,將使用(0,0)。 dataType參數(shù)應(yīng)該是DataBuffer類中定義的枚舉值之一。
目前支持的唯一數(shù)據(jù)類型是TYPE_BYTE,TYPE_USHORT和TYPE_INT。
參數(shù)
dataType - 用于存儲樣本的數(shù)據(jù)類型
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
bands - 頻段數(shù)
location -
Raster
結(jié)果
具有指定數(shù)據(jù)類型,寬度,高度和波段數(shù)的WritableRaster對象。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
createBandedRaster public static?WritableRaster?createBandedRaster?(int?dataType,
int?w,
int?h,
int?scanlineStride,
int[]?bankIndices,
int[]?bandOffsets,
Point?location)
基于BandedSampleModel創(chuàng)建一個Raster,其中包含指定的數(shù)據(jù)類型,寬度,高度,掃描行間距,行索引和波段偏移。
band的數(shù)量是從bankIndices.length和bandOffsets.length推斷出來的,它們必須相同。
Raster的左上角由location參數(shù)給出。 dataType參數(shù)應(yīng)該是DataBuffer類中定義的枚舉值之一。
目前支持的唯一數(shù)據(jù)類型是TYPE_BYTE,TYPE_USHORT和TYPE_INT。
參數(shù)
dataType - 用于存儲樣本的數(shù)據(jù)類型
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
scanlineStride - 圖像數(shù)據(jù)的行
scanlineStride
bankIndices - 每個頻段的銀行指數(shù)
bandOffsets - 所有波段的偏移量
location -
Raster
結(jié)果
一個WritableRaster對象,具有指定的數(shù)據(jù)類型,寬度,高度,掃描行間距,銀行索引和波段偏移。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
dataType是不支持的數(shù)據(jù)類型,這是一個
DataBuffer.TYPE_BYTE ,
DataBuffer.TYPE_USHORT或
DataBuffer.TYPE_INT
bankIndices或
bandOffsets是
null
createPackedRaster public static?WritableRaster?createPackedRaster?(int?dataType,
int?w,
int?h,
int[]?bandMasks,
Point?location)
基于具有指定數(shù)據(jù)類型,寬度,高度和波段掩碼的SinglePixelPackedSampleModel創(chuàng)建柵格。
band的數(shù)量是從bandMasks.length推斷出來的。
Raster的左上角由location參數(shù)給出。 如果location為null,將使用(0,0)。 dataType參數(shù)應(yīng)該是DataBuffer類中定義的枚舉值之一。
目前支持的唯一數(shù)據(jù)類型是TYPE_BYTE,TYPE_USHORT和TYPE_INT。
參數(shù)
dataType - 用于存儲樣本的數(shù)據(jù)類型
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
bandMasks - 包含每個波段條目的數(shù)組
location -
Raster
結(jié)果
具有指定數(shù)據(jù)類型,寬度,高度和帶掩碼的WritableRaster對象。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
dataType是不支持的數(shù)據(jù)類型,這是一個
DataBuffer.TYPE_BYTE ,
DataBuffer.TYPE_USHORT或
DataBuffer.TYPE_INT
createPackedRaster public static?WritableRaster?createPackedRaster?(int?dataType,
int?w,
int?h,
int?bands,
int?bitsPerBand,
Point?location)
基于打包的SampleModel創(chuàng)建一個Raster,其中包含指定的數(shù)據(jù)類型,寬度,高度,波段數(shù)和每個波段的位數(shù)。
如果band的數(shù)量是1,則SampleModel將是MultiPixelPackedSampleModel。
如果band的數(shù)量大于1,則SampleModel將是SinglePixelPackedSampleModel,每個band具有bitsPerBand位。 在任何一種情況下,都必須滿足相應(yīng)SampleModel對dataType和bitsPerBand的要求。
Raster的左上角由location參數(shù)給出。 如果location為null,將使用(0,0)。 dataType參數(shù)應(yīng)該是DataBuffer類中定義的枚舉值之一。
目前支持的唯一數(shù)據(jù)類型是TYPE_BYTE,TYPE_USHORT和TYPE_INT。
參數(shù)
dataType - 用于存儲樣本的數(shù)據(jù)類型
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
bands - 頻段數(shù)
bitsPerBand - 每個頻段的比特數(shù)
location -
Raster
結(jié)果
一個WritableRaster對象,具有指定的數(shù)據(jù)類型,寬度,高度,帶數(shù)和每個帶的位數(shù)。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
bitsPerBand和
bands大于
dataType所持有的
dataType
bitsPerBand或
bands不大于零
dataType是不支持的數(shù)據(jù)類型,這是一個
DataBuffer.TYPE_BYTE ,
DataBuffer.TYPE_USHORT或
DataBuffer.TYPE_INT
createInterleavedRaster public static?WritableRaster?createInterleavedRaster?(DataBuffer?dataBuffer,
int?w,
int?h,
int?scanlineStride,
int?pixelStride,
int[]?bandOffsets,
Point?location)
基于PixelInterleavedSampleModel創(chuàng)建一個Raster,其中包含指定的DataBuffer,width,height,scanline stride,pixel stride和band offset。
band的數(shù)量是從bandOffsets.length推斷出來的。
Raster的左上角由location參數(shù)給出。
如果location為null,將使用(0,0)。
請注意,不支持交錯DataBuffer.TYPE_INT柵格。 要創(chuàng)建類型為DataBuffer.TYPE_INT的1波段光柵,請使用Raster.createPackedRaster()。
參數(shù)
dataBuffer - 包含圖像數(shù)據(jù)的
DataBuffer
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
scanlineStride - 圖像數(shù)據(jù)的行
scanlineStride
pixelStride - 圖像數(shù)據(jù)的像素跨度
bandOffsets - 所有樂隊的抵消
location -
Raster
結(jié)果
一個WritableRaster對象,具有指定的
DataBuffer ,寬度,高度,掃描行間距,像素跨度和帶偏移。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
dataType是不支持的數(shù)據(jù)類型,這是一個
DataBuffer.TYPE_BYTE ,
DataBuffer.TYPE_USHORT
createBandedRaster public static?WritableRaster?createBandedRaster?(DataBuffer?dataBuffer,
int?w,
int?h,
int?scanlineStride,
int[]?bankIndices,
int[]?bandOffsets,
Point?location)
基于BandedSampleModel創(chuàng)建一個Raster,其中包含指定的DataBuffer,width,height,scanline stride,bank indices和band offset。
band的數(shù)量是從bankIndices.length和bandOffsets.length推斷出來的,它們必須相同。
Raster的左上角由location參數(shù)給出。
如果location為null,將使用(0,0)。
參數(shù)
dataBuffer - 包含圖像數(shù)據(jù)的
DataBuffer
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
scanlineStride - 圖像數(shù)據(jù)的行
scanlineStride
bankIndices - 每個頻段的銀行指數(shù)
bandOffsets - 所有樂隊的抵消
location -
Raster
結(jié)果
一個WritableRaster對象,具有指定的
DataBuffer ,寬度,高度,掃描行間距,行索引和波段偏移。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
dataType是不支持的數(shù)據(jù)類型,這是一個
DataBuffer.TYPE_BYTE ,
DataBuffer.TYPE_USHORT或
DataBuffer.TYPE_INT
createPackedRaster public static?WritableRaster?createPackedRaster?(DataBuffer?dataBuffer,
int?w,
int?h,
int?scanlineStride,
int[]?bandMasks,
Point?location)
基于SinglePixelPackedSampleModel創(chuàng)建一個Raster,其中包含指定的DataBuffer,width,height,scanline stride和band mask。
band的數(shù)量是從bandMasks.length推斷出來的。
Raster的左上角由location參數(shù)給出。
如果location為null,將使用(0,0)。
參數(shù)
dataBuffer - 包含圖像數(shù)據(jù)的
DataBuffer
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
scanlineStride - 圖像數(shù)據(jù)的行
scanlineStride
bandMasks - 包含每個波段條目的數(shù)組
location -
Raster
結(jié)果
具有指定的
DataBuffer ,寬度,高度,掃描行間距和帶蒙版的WritableRaster對象。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
dataType是不支持的數(shù)據(jù)類型,這是一個
DataBuffer.TYPE_BYTE ,
DataBuffer.TYPE_USHORT或
DataBuffer.TYPE_INT
createPackedRaster public static?WritableRaster?createPackedRaster?(DataBuffer?dataBuffer,
int?w,
int?h,
int?bitsPerPixel,
Point?location)
基于MultiPixelPackedSampleModel創(chuàng)建一個Raster,其中包含指定的DataBuffer,width,height和每像素位數(shù)。
Raster的左上角由location參數(shù)給出。
如果location為null,將使用(0,0)。
參數(shù)
dataBuffer - 包含圖像數(shù)據(jù)的
DataBuffer
w - 圖像數(shù)據(jù)的寬度(以像素為單位)
h - 圖像數(shù)據(jù)的高度(以像素為單位)
bitsPerPixel - 每個像素的位數(shù)
location -
Raster
結(jié)果
一個WritableRaster對象,具有指定的
DataBuffer ,寬度,高度和每像素位數(shù)。
異常
w或
h小于或等于零,或計算
location.x + w或
location.y + h導(dǎo)致整數(shù)溢出
dataType是不支持的數(shù)據(jù)類型,這是一個
DataBuffer.TYPE_BYTE ,
DataBuffer.TYPE_USHORT或
DataBuffer.TYPE_INT
createRaster public static?Raster?createRaster?(SampleModel?sm,
DataBuffer?db,
Point?location)
使用指定的SampleModel和DataBuffer創(chuàng)建Raster。
Raster的左上角由location參數(shù)給出。
如果location為null,將使用(0,0)。
參數(shù)
sm - 指定的
SampleModel
db - 指定的
DataBuffer
location -
Raster
結(jié)果
一個
Raster帶有指定
SampleModel ,
DataBuffer ,和位置。
異常
location.x + sm.getWidth()或
location.y + sm.getHeight()導(dǎo)致整數(shù)溢出
db具有多個庫,則
sm是PixelInterleavedSampleModel,SinglePixelPackedSampleModel或MultiPixelPackedSampleModel。
createWritableRaster public static?WritableRaster?createWritableRaster?(SampleModel?sm,
Point?location)
使用指定的SampleModel創(chuàng)建WritableRaster。
Raster的左上角由location參數(shù)給出。
如果location為null,將使用(0,0)。
參數(shù)
sm - 指定的
SampleModel
location -
WritableRaster
結(jié)果
a
WritableRaster具有指定的
SampleModel和位置。
異常
location.x + sm.getWidth()或
location.y + sm.getHeight()導(dǎo)致整數(shù)溢出
createWritableRaster public static?WritableRaster?createWritableRaster?(SampleModel?sm,
DataBuffer?db,
Point?location)
使用指定的SampleModel和DataBuffer創(chuàng)建WritableRaster。
Raster的左上角由location參數(shù)給出。
如果location為null,將使用(0,0)。
參數(shù)
sm - 指定的
SampleModel
db - 指定的
DataBuffer
location -
WritableRaster
結(jié)果
一個
WritableRaster帶有指定
SampleModel ,
DataBuffer ,和位置。
異常
location.x + sm.getWidth()或
location.y + sm.getHeight()導(dǎo)致整數(shù)溢出
db具有多個庫,則
sm是PixelInterleavedSampleModel,SinglePixelPackedSampleModel或MultiPixelPackedSampleModel。
getParent public?Raster?getParent()
返回此Raster的父Raster(如果有)或null。
結(jié)果
父Raster或
null 。
getSampleModelTranslateX public final?int?getSampleModelTranslateX()
返回從SampleModel坐標(biāo)系到Raster坐標(biāo)系的X平移。
要將像素的X坐標(biāo)從柵格坐標(biāo)系轉(zhuǎn)換為SampleModel坐標(biāo)系,必須減去該值。
結(jié)果
從Raster的SampleModel的坐標(biāo)空間到Raster的坐標(biāo)空間的X平移。
getSampleModelTranslateY public final?int?getSampleModelTranslateY()
返回從SampleModel坐標(biāo)系到Raster坐標(biāo)系的Y平移。
要將像素的Y坐標(biāo)從光柵坐標(biāo)系轉(zhuǎn)換為SampleModel坐標(biāo)系,必須減去此值。
結(jié)果
從Raster的SampleModel的坐標(biāo)空間到Raster的坐標(biāo)空間的Y平移。
createCompatibleWritableRaster public?WritableRaster?createCompatibleWritableRaster()
使用相同的SampleModel和新的初始化DataBuffer創(chuàng)建與此Raster大小相同的兼容WritableRaster。
結(jié)果
兼容的
WritableRaster具有相同的樣本模型和新的數(shù)據(jù)緩沖區(qū)。
createCompatibleWritableRaster public?WritableRaster?createCompatibleWritableRaster?(int?w,
int?h)
創(chuàng)建具有指定大小的兼容WritableRaster,新的SampleModel和新初始化的DataBuffer。
參數(shù)
w - 新
WritableRaster的指定寬度
h - 新
WritableRaster的指定高度
結(jié)果
具有指定大小的兼容
WritableRaster以及新的樣本模型和數(shù)據(jù)緩沖區(qū)。
異常
createCompatibleWritableRaster public?WritableRaster?createCompatibleWritableRaster?(Rectangle?rect)
創(chuàng)建兼容的WritableRaster,其中包含由rect指定的位置(minX,minY)和大小(寬度,高度),新的SampleModel和新的初始化DataBuffer。
參數(shù)
rect -一個
Rectangle指定的大小和位置
WritableRaster
結(jié)果
具有指定大小和位置的兼容
WritableRaster以及新的樣本模型和數(shù)據(jù)緩沖區(qū)。
異常
rect寬度或高度小于或等于零,或計算
rect.x + rect.width或
rect.y + rect.height導(dǎo)致整數(shù)溢出
createCompatibleWritableRaster public?WritableRaster?createCompatibleWritableRaster?(int?x,
int?y,
int?w,
int?h)
創(chuàng)建一個兼容的WritableRaster,它具有指定的位置(minX,minY)和大小(寬度,高度),一個新的SampleModel和一個新的初始化DataBuffer。
參數(shù)
x -在X中的左上角坐標(biāo)
WritableRaster
y -的Y的左上角坐標(biāo)
WritableRaster
w - 指定的寬度
WritableRaster
h -在指定高度
WritableRaster
結(jié)果
具有指定大小和位置的兼容
WritableRaster以及新的樣本模型和數(shù)據(jù)緩沖區(qū)。
異常
w或
h小于或等于零,或計算
x + w或
y + h導(dǎo)致整數(shù)溢出
createTranslatedChild public?Raster?createTranslatedChild?(int?childMinX,
int?childMinY)
創(chuàng)建一個與此相同大小的Raster,SampleModel和DataBuffer,但具有不同的位置。
新的Raster將擁有對當(dāng)前Raster的引用,可通過其getParent()方法訪問。
參數(shù)
childMinX - 新
Raster左上角的X坐標(biāo)
childMinY - 新
Raster左上角的Y坐標(biāo)
結(jié)果
新
Raster相同大小,SampleModel和DataBuffer與此
Raster ,但與指定的位置。
異常
childMinX + this.getWidth()或
childMinY + this.getHeight()導(dǎo)致整數(shù)溢出
createChild public?Raster?createChild?(int?parentX,
int?parentY,
int?width,
int?height,
int?childMinX,
int?childMinY,
int[]?bandList)
返回一個新的Raster,它共享此Raster的DataBuffer的全部或部分內(nèi)容。
新的Raster將擁有對當(dāng)前Raster的引用,可通過其getParent()方法訪問。
parentX,parentY,width和height參數(shù)在此Raster的坐標(biāo)空間中形成一個Rectangle,指示要共享的像素區(qū)域。 如果此Rectangle未包含在當(dāng)前Raster的邊界內(nèi),則會引發(fā)錯誤。
新的Raster可以另外轉(zhuǎn)換為平面的不同坐標(biāo)系,而不是當(dāng)前Raster使用的坐標(biāo)系。 childMinX和childMinY參數(shù)給出返回的Raster的左上角像素的新(x,y)坐標(biāo); 新Raster中的坐標(biāo)(childMinX,childMinY)將映射到與當(dāng)前Raster中坐標(biāo)(parentX,parentY)相同的像素。
可以通過bandList參數(shù)將新Raster定義為僅包含當(dāng)前Raster的頻帶的子集,可能重新排序。 如果bandList為null,則將其包含在當(dāng)前順序中的當(dāng)前Raster的所有band。
要創(chuàng)建包含當(dāng)前Raster的子區(qū)域但共享其坐標(biāo)系和波段的新Raster,應(yīng)調(diào)用此方法,其中childMinX等于parentX,childMinY等于parentY,bandList等于null。
參數(shù)
parentX - 此Raster坐標(biāo)中左上角的X坐標(biāo)
parentY - 此Raster坐標(biāo)中左上角的Y坐標(biāo)
width - 以(parentX,parentY)開頭的區(qū)域?qū)挾?/p>
height - 從(parentX,parentY)開始的區(qū)域的高度。
childMinX - 返回的Raster左上角的X坐標(biāo)
childMinY - 返回的Raster左上角的Y坐標(biāo)
bandList - 波段索引數(shù)組,或null以使用所有波段
結(jié)果
一個新的
Raster 。
異常
width或
height小于或等于0,或者計算任何的
parentX + width ,
parentY + height ,
childMinX + width ,或
childMinY + height導(dǎo)致整數(shù)溢出
getBounds public?Rectangle?getBounds()
返回此Raster的邊界Rectangle。
此函數(shù)返回與getMinX / MinY / Width / Height相同的信息。
結(jié)果
此
Raster的邊界框。
getMinX public final?int?getMinX()
返回Raster的最小有效X坐標(biāo)。
結(jié)果
這個
Raster的最小x坐標(biāo)。
getMinY public final?int?getMinY()
返回Raster的最小有效Y坐標(biāo)。
結(jié)果
這個
Raster的最小y坐標(biāo)。
getWidth public final?int?getWidth()
返回Raster的寬度(以像素為單位)。
結(jié)果
這個寬度
Raster 。
getHeight public final?int?getHeight()
返回Raster的高度(以像素為單位)。
結(jié)果
這個高度
Raster 。
getNumBands public final?int?getNumBands()
返回此Raster中的band數(shù)(每個像素的樣本數(shù))。
結(jié)果
這個
Raster的樂隊數(shù)量。
getNumDataElements public final?int?getNumDataElements()
返回通過getDataElements和setDataElements方法傳輸一個像素所需的數(shù)據(jù)元素數(shù)。
當(dāng)通過這些方法傳輸像素時,它們可以以打包或解包格式傳輸,具體取決于底層SampleModel的實現(xiàn)。
使用這些方法,像素作為getTransferType()給出的基本類型的getNumDataElements()元素數(shù)組傳輸。
TransferType可能與DataBuffer的存儲數(shù)據(jù)類型相同或不同。
結(jié)果
數(shù)據(jù)元素的數(shù)量。
getTransferType public final?int?getTransferType()
返回用于通過getDataElements和setDataElements方法傳輸像素的TransferType。
當(dāng)通過這些方法傳輸像素時,它們可以以打包或解包格式傳輸,具體取決于底層SampleModel的實現(xiàn)。
使用這些方法,像素作為getTransferType()給出的基本類型的getNumDataElements()元素數(shù)組傳輸。
TransferType可能與DataBuffer的存儲數(shù)據(jù)類型相同或不同。
TransferType將是DataBuffer中定義的類型之一。
結(jié)果
這種轉(zhuǎn)移類型。
getDataBuffer public?DataBuffer?getDataBuffer()
返回與此Raster關(guān)聯(lián)的DataBuffer。
結(jié)果
DataBuffer的
Raster 。
getSampleModel public?SampleModel?getSampleModel()
返回描述圖像數(shù)據(jù)布局的SampleModel。
結(jié)果
SampleModel的
Raster 。
getDataElements public?Object?getDataElements?(int?x,
int?y,
Object?outData)
返回TransferType類型的基本數(shù)組中單個像素的數(shù)據(jù)。
對于Java 2D(tm)API支持的圖像數(shù)據(jù),這將是DataBuffer.TYPE_BYTE,DataBuffer.TYPE_USHORT,DataBuffer.TYPE_INT,DataBuffer.TYPE_SHORT,DataBuffer.TYPE_FLOAT或DataBuffer.TYPE_DOUBLE之一。
數(shù)據(jù)可以以打包格式返回,從而提高數(shù)據(jù)傳輸?shù)男省?/p>
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
如果輸入對象為非null并且引用除TransferType數(shù)組之外的任何內(nèi)容,則拋出ClassCastException。
參數(shù)
x - 像素位置的X坐標(biāo)
y - 像素位置的Y坐標(biāo)
outData - 對getTransferType()和length getNumDataElements()定義的類型數(shù)組的對象引用。
如果為null,則將分配適當(dāng)類型和大小的數(shù)組
結(jié)果
對由getTransferType()定義的類型數(shù)組的對象引用,其中包含請求的像素數(shù)據(jù)。
異常
另請參見:
getDataElements public?Object?getDataElements?(int?x,
int?y,
int?w,
int?h,
Object?outData)
返回TransferType類型的基本數(shù)組中指定矩形像素的像素數(shù)據(jù)。
對于Java 2D API支持的圖像數(shù)據(jù),這將是DataBuffer.TYPE_BYTE,DataBuffer.TYPE_USHORT,DataBuffer.TYPE_INT,DataBuffer.TYPE_SHORT,DataBuffer.TYPE_FLOAT或DataBuffer.TYPE_DOUBLE之一。
數(shù)據(jù)可以以打包格式返回,從而提高數(shù)據(jù)傳輸?shù)男省?/p>
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
如果輸入對象為非null并且引用除TransferType數(shù)組之外的任何內(nèi)容,則拋出ClassCastException。
參數(shù)
x - 左上角像素位置的X坐標(biāo)
y - 左上角像素位置的Y坐標(biāo)
w - 像素矩形的寬度
h - 像素矩形的高度
outData - 對getTransferType()和length w * h * getNumDataElements()定義的類型數(shù)組的對象引用。
如果為null,則將分配適當(dāng)類型和大小的數(shù)組。
結(jié)果
對由getTransferType()定義的類型數(shù)組的對象引用,其中包含請求的像素數(shù)據(jù)。
異常
另請參見:
getPixel public?int[]?getPixel?(int?x,
int?y,
int[]?iArray)
返回指定像素的int數(shù)組中的樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 像素位置的X坐標(biāo)
y - 像素位置的Y坐標(biāo)
iArray - 可選的預(yù)分配int數(shù)組
結(jié)果
指定像素的樣本。
異常
getPixel public?float[]?getPixel?(int?x,
int?y,
float[]?fArray)
返回指定像素的float數(shù)組中的樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 像素位置的X坐標(biāo)
y - 像素位置的Y坐標(biāo)
fArray - 可選的預(yù)分配浮點數(shù)組
結(jié)果
指定像素的樣本。
異常
getPixel public?double[]?getPixel?(int?x,
int?y,
double[]?dArray)
返回指定像素的double數(shù)組中的樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 像素位置的X坐標(biāo)
y - 像素位置的Y坐標(biāo)
dArray - 可選的預(yù)分配雙數(shù)組
結(jié)果
指定像素的樣本。
異常
getPixels public?int[]?getPixels?(int?x,
int?y,
int?w,
int?h,
int[]?iArray)
返回一個int數(shù)組,其中包含像素矩形的所有樣本,每個數(shù)組元素一個樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 左上角像素位置的X坐標(biāo)
y - 左上角像素位置的Y坐標(biāo)
w - 像素矩形的寬度
h - 像素矩形的高度
iArray - 可選的預(yù)分配int數(shù)組
結(jié)果
指定矩形像素的樣本。
異常
getPixels public?float[]?getPixels?(int?x,
int?y,
int?w,
int?h,
float[]?fArray)
返回一個float數(shù)組,其中包含像素矩形的所有樣本,每個數(shù)組元素一個樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 像素位置的X坐標(biāo)
y - 像素位置的Y坐標(biāo)
w - 像素矩形的寬度
h - 像素矩形的高度
fArray - 可選的預(yù)分配浮點數(shù)組
結(jié)果
指定矩形像素的樣本。
異常
getPixels public?double[]?getPixels?(int?x,
int?y,
int?w,
int?h,
double[]?dArray)
返回一個double數(shù)組,其中包含像素矩形的所有樣本,每個數(shù)組元素一個樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 左上角像素位置的X坐標(biāo)
y - 左上角像素位置的Y坐標(biāo)
w - 像素矩形的寬度
h - 像素矩形的高度
dArray - 可選的預(yù)分配雙數(shù)組
結(jié)果
指定矩形像素的樣本。
異常
getSample public?int?getSample?(int?x,
int?y,
int?b)
將位于(x,y)的像素的指定band中的樣本返回為int。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 像素位置的X坐標(biāo)
y - 像素位置的Y坐標(biāo)
b - 樂隊返回
結(jié)果
指定坐標(biāo)中像素的指定波段中的樣本。
異常
getSampleFloat public?float?getSampleFloat?(int?x,
int?y,
int?b)
將位于(x,y)的像素的指定band中的樣本返回為float。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 像素位置的X坐標(biāo)
y - 像素位置的Y坐標(biāo)
b - 樂隊返回
結(jié)果
指定坐標(biāo)中像素的指定波段中的樣本。
異常
getSampleDouble public?double?getSampleDouble?(int?x,
int?y,
int?b)
將位于(x,y)的像素的指定波段中的樣本返回為double。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 像素位置的X坐標(biāo)
y - 像素位置的Y坐標(biāo)
b - 樂隊返回
結(jié)果
指定坐標(biāo)中像素的指定波段中的樣本。
異常
getSamples public?int[]?getSamples?(int?x,
int?y,
int?w,
int?h,
int?b,
int[]?iArray)
返回int數(shù)組中指定矩形像素的指定band的樣本,每個數(shù)組元素一個樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 左上角像素位置的X坐標(biāo)
y - 左上角像素位置的Y坐標(biāo)
w - 像素矩形的寬度
h - 像素矩形的高度
b - 樂隊返回
iArray - 可選的預(yù)分配int數(shù)組
結(jié)果
指定像素矩形的指定波段的樣本。
異常
getSamples public?float[]?getSamples?(int?x,
int?y,
int?w,
int?h,
int?b,
float[]?fArray)
返回float數(shù)組中指定矩形像素的指定band的樣本,每個數(shù)組元素一個樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 左上角像素位置的X坐標(biāo)
y - 左上角像素位置的Y坐標(biāo)
w - 像素矩形的寬度
h - 像素矩形的高度
b - 要返回的樂隊
fArray - 可選的預(yù)分配浮點數(shù)組
結(jié)果
指定像素矩形的指定波段的樣本。
異常
getSamples public?double[]?getSamples?(int?x,
int?y,
int?w,
int?h,
int?b,
double[]?dArray)
返回雙精度數(shù)組中指定矩形像素的指定波段的樣本,每個數(shù)組元素一個樣本。
如果坐標(biāo)不在邊界內(nèi),則可能拋出ArrayIndexOutOfBoundsException。
但是,不保證顯式邊界檢查。
參數(shù)
x - 左上角像素位置的X坐標(biāo)
y - 左上角像素位置的Y坐標(biāo)
w - 像素矩形的寬度
h - 像素矩形的高度
b - 樂隊返回
dArray - 可選的預(yù)分配雙數(shù)組
結(jié)果
指定像素矩形的指定波段的樣本。
異常
總結(jié)
以上是生活随笔為你收集整理的java raster_Raster的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java13页_Java 13 新特性及
- 下一篇: php丢包率测试,linux 网络延时、