|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.awt.image.BandCombineOp
public class BandCombineOp
此類別使用一個指定矩陣對 Raster 中的 band 進行任意線性組合。
矩陣的寬度必須等於源 Raster 中的 band 數(可以加一)。如果矩陣中的列數比 band 數多 1,則在 band 樣本向量的結尾處存在一個隱含的 1,它表示一個像素。矩陣的高度必須等於目標圖像中的 band 數。
例如,對於一個 band 數為 3 的 Raster,為了反轉 Raster 的第二個 band,可以對每個像素應用以下變換。
[ 1.0 0.0 0.0 0.0 ] [ b1 ]
[ 0.0 -1.0 0.0 255.0 ] x [ b2 ]
[ 0.0 0.0 1.0 0.0 ] [ b3 ]
[ 1 ]
注意,源圖像和目標圖像可以是同一個物件。
| 建構子摘要 | |
|---|---|
BandCombineOp(float[][] matrix,
RenderingHints hints)
建構一個具有指定矩陣的 BandCombineOp。 |
|
| 方法摘要 | |
|---|---|
WritableRaster |
createCompatibleDestRaster(Raster src)
創建一個經過檢查的目標 Raster,它具有正確大小和 band 數。 |
WritableRaster |
filter(Raster src,
WritableRaster dst)
使用建構子中指定的矩陣變換該 Raster。 |
Rectangle2D |
getBounds2D(Raster src)
返回變換後目標圖像的邊界框。 |
float[][] |
getMatrix()
返回線性組合矩陣的一個副本。 |
Point2D |
getPoint2D(Point2D srcPt,
Point2D dstPt)
返回與源 Raster 中給定點對應的目標點的位置。 |
RenderingHints |
getRenderingHints()
返回針對此操作呈現的提示。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public BandCombineOp(float[][] matrix,
RenderingHints hints)
BandCombineOp。矩陣的寬度必須等於源 Raster 中的 band 數(可以加一)。如果矩陣中的列數比 band 數多 1,則在 band 樣本向量的結尾處存在一個隱含的 1,它表示一個像素。矩陣的高度必須等於目標圖像中的 band 數。
第一個下標是行索引,第二個下標是列索引。此操作沒有使用當前定義的呈現提示;RenderingHints 參數可以為 null。
matrix - 進行 band 組合操作要使用的矩陣。hints - 用於此操作的 RenderingHints 物件。當前沒有使用提示,因此它可以為 null。| 方法詳細資訊 |
|---|
public final float[][] getMatrix()
public WritableRaster filter(Raster src,
WritableRaster dst)
Raster。如果源圖像或目標圖像中的 band 數與矩陣不一致,則拋出 IllegalArgumentException。有關更多詳細資訊,請參閱類別註釋。
如果目標圖像為 null,則將創建它,使 band 數等於矩陣中的行數。即使該操作引起資料溢位,也不會拋出異常。
RasterOp 中的 filtersrc - 要過濾的 Raster。dst - 要在其中存儲過濾操作結果的 Raster。
Raster。
IllegalArgumentException - 如果源圖像或目標圖像中的 band 數與矩陣不一致。public final Rectangle2D getBounds2D(Raster src)
IllegalArgumentException。有關更多詳細資訊,請參閱類別註釋。
RasterOp 中的 getBounds2Dsrc - 要過濾的 Raster。
Rectangle2D。
IllegalArgumentException - 如果源圖像中的 band 數與矩陣不一致。public WritableRaster createCompatibleDestRaster(Raster src)
Raster,它具有正確大小和 band 數。如果源圖像中的 band 數與矩陣不一致,則拋出 IllegalArgumentException。有關更多詳細資訊,請參閱類別註釋。
RasterOp 中的 createCompatibleDestRastersrc - 要過濾的 Raster。
Raster。
public final Point2D getPoint2D(Point2D srcPt,
Point2D dstPt)
Raster 中給定點對應的目標點的位置。如果指定了 dstPt,則使用它來保存返回值。由於這不是一個幾何操作,因此返回的點與指定的 srcPt 相同。
RasterOp 中的 getPoint2DsrcPt - 表示源 Raster 中點的 Point2DdstPt - 用於存儲結果的 Point2D。
Point2D。public final RenderingHints getRenderingHints()
RasterOp 中的 getRenderingHintsRenderingHints 物件。如果沒有設置提示,則返回 null。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。