public class BufferedImage extends Image implements WritableRenderedImage, Transparency
BufferedImage
サブクラスは、イメージ・データのアクセス可能なバッファを備えたImage
を記述します。BufferedImage
は、ColorModel
およびイメージ・データのRaster
で構成されています。Raster
のSampleModel
バンド数および型は、色成分およびアルファ成分を表すためにColorModel
によって要求される数および型と一致している必要があります。すべてのBufferedImage
オブジェクトの左上隅の座標は(0, 0)です。このため、BufferedImage
の作成に使用されるRaster
はminX=0およびminY=0である必要があります。
このクラスは、Raster
のデータの取出し方法と設定方法、およびColorModel
の色の記述方法に依存します。
ColorModel
、Raster
、WritableRaster
修飾子と型 | フィールドと説明 |
---|---|
static int |
TYPE_3BYTE_BGR
青、緑、および赤が3バイトに格納された8ビットRGB色成分(WindowsスタイルのBGRカラー・モデルに対応)によるイメージを表します。
|
static int |
TYPE_4BYTE_ABGR
青、緑、および赤が3バイトに格納され、1バイトのアルファを持つ8ビットRGBA色成分によるイメージを表します。
|
static int |
TYPE_4BYTE_ABGR_PRE
青、緑、および赤が3バイトに格納され、1バイトのアルファを持つ8ビットRGBA色成分によるイメージを表します。
|
static int |
TYPE_BYTE_BINARY
不透明なbyteパックの1、2、または4ビット・イメージを表します。
|
static int |
TYPE_BYTE_GRAY
符号なしbyteグレー・スケール・イメージ(インデックスなし)を表します。
|
static int |
TYPE_BYTE_INDEXED
インデックス付きbyteイメージを表します。
|
static int |
TYPE_CUSTOM
イメージ型が認識されないので、イメージは必ずカスタマイズされています。
|
static int |
TYPE_INT_ARGB
整数型ピクセルにパックされた8ビットRGBA色成分によるイメージを表します。
|
static int |
TYPE_INT_ARGB_PRE
整数型ピクセルにパックされた8ビットRGBA色成分によるイメージを表します。
|
static int |
TYPE_INT_BGR
青、緑、および赤が整数型ピクセルにパックされた8ビットRGB色成分(WindowsスタイルまたはSolarisスタイルのBGRカラー・モデルに対応)によるイメージを表します。
|
static int |
TYPE_INT_RGB
整数型ピクセルにパックされた8ビットRGB色成分によるイメージを表します。
|
static int |
TYPE_USHORT_555_RGB
アルファなしの5-5-5 RGB色成分(5ビットの赤、5ビットの緑、5ビットの青)によるイメージを表します。
|
static int |
TYPE_USHORT_565_RGB
アルファなしの5-6-5 RGB色成分(5ビットの赤、6ビットの緑、5ビットの青)によるイメージを表します。
|
static int |
TYPE_USHORT_GRAY
符号なしshortグレー・スケール・イメージ(インデックスなし)を表します。
|
accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty
BITMASK, OPAQUE, TRANSLUCENT
コンストラクタと説明 |
---|
BufferedImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable<?,?> properties)
指定された
ColorModel とRaster で新しいBufferedImage を構築します。 |
BufferedImage(int width, int height, int imageType)
定義済みイメージ型の中の1つで
BufferedImage を構築します。 |
BufferedImage(int width, int height, int imageType, IndexColorModel cm)
定義済みイメージ型のTYPE_BYTE_BINARYまたはTYPE_BYTE_INDEXEDのどちらかで
BufferedImage を構築します。 |
修飾子と型 | メソッドと説明 |
---|---|
void |
addTileObserver(TileObserver to)
タイル・オブザーバを追加します。
|
void |
coerceData(boolean isAlphaPremultiplied)
isAlphaPremultiplied 変数で指定された状態にデータを一致させます。 |
WritableRaster |
copyData(WritableRaster outRaster)
BufferedImage の任意の矩形領域を計算し、指定されたWritableRaster にコピーします。 |
Graphics2D |
createGraphics()
この
BufferedImage に描画するために使用できるGraphics2D を作成します。 |
WritableRaster |
getAlphaRaster()
別の空間アルファ・チャネルをサポートする
ColorModel オブジェクト(ComponentColorModel およびDirectColorModel など)でBufferedImage のアルファ・チャネルを表すWritableRaster を返します。 |
ColorModel |
getColorModel()
ColorModel を返します。 |
Raster |
getData()
イメージを1つの大きなタイルとして返します。
|
Raster |
getData(Rectangle rect)
BufferedImage の任意の領域を計算して返します。 |
Graphics |
getGraphics()
このメソッドは
Graphics2D を返しますが、ここでは下位互換性のために提供されます。 |
int |
getHeight()
BufferedImage の高さを返します。 |
int |
getHeight(ImageObserver observer)
BufferedImage の高さを返します。 |
int |
getMinTileX()
x方向の最小タイル・インデックスを返します。
|
int |
getMinTileY()
y方向の最小タイル・インデックスを返します。
|
int |
getMinX()
この
BufferedImage の最小x座標を返します。 |
int |
getMinY()
この
BufferedImage の最小y座標を返します。 |
int |
getNumXTiles()
x方向のタイルの数を返します。
|
int |
getNumYTiles()
y方向のタイルの数を返します。
|
Object |
getProperty(String name)
イメージのプロパティを名前で返します。
|
Object |
getProperty(String name, ImageObserver observer)
イメージのプロパティを名前で返します。
|
String[] |
getPropertyNames()
getProperty(String) が認識する名前の配列を返すか、プロパティ名が認識されない場合はnull を返します。 |
WritableRaster |
getRaster()
WritableRaster を返します。 |
int |
getRGB(int x, int y)
デフォルトRGBカラー・モデル(TYPE_INT_ARGB)およびデフォルトsRGBカラー・スペースで整数型ピクセルを返します。
|
int[] |
getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
デフォルトRGBカラー・モデル(TYPE_INT_ARGB)およびデフォルトsRGBカラー・スペースでイメージ・データの一部から整数型ピクセルの配列を返します。
|
SampleModel |
getSampleModel()
この
BufferedImage に関連付けられたSampleModel を返します。 |
ImageProducer |
getSource()
イメージのピクセルを生成するオブジェクトを返します。
|
Vector<RenderedImage> |
getSources()
|
BufferedImage |
getSubimage(int x, int y, int w, int h)
指定された矩形領域で定義されるサブイメージを返します。
|
Raster |
getTile(int tileX, int tileY)
タイル(
tileX , tileY )を返します。 |
int |
getTileGridXOffset()
原点を基準にタイル・グリッドのxオフセットを返します。たとえば、タイルの位置(0, 0)のx座標です。
|
int |
getTileGridYOffset()
原点を基準にタイル・グリッドのyオフセットを返します。たとえば、タイルの位置(0, 0)のy座標です。
|
int |
getTileHeight()
タイルの高さをピクセル単位で返します。
|
int |
getTileWidth()
タイルの幅をピクセル単位で返します。
|
int |
getTransparency()
透明度を返します。
|
int |
getType()
イメージ型を返します。
|
int |
getWidth()
BufferedImage の幅を返します。 |
int |
getWidth(ImageObserver observer)
BufferedImage の幅を返します。 |
WritableRaster |
getWritableTile(int tileX, int tileY)
書込みのためにタイルをチェック・アウトします。
|
Point[] |
getWritableTileIndices()
どのタイルが書込みのためにチェック・アウトされているかを示す
Point オブジェクトの配列を返します。 |
boolean |
hasTileWriters()
タイルが書込み用にチェック・アウトされているかどうかを返します。
|
boolean |
isAlphaPremultiplied()
アルファがあらかじめ乗算されているかどうかを返します。
|
boolean |
isTileWritable(int tileX, int tileY)
タイルが書込み用にチェック・アウトされているかどうかを返します。
|
void |
releaseWritableTile(int tileX, int tileY)
タイルに書き込むためのアクセス権を放棄します。
|
void |
removeTileObserver(TileObserver to)
タイル・オブザーバを削除します。
|
void |
setData(Raster r)
イメージの矩形領域を指定された
Raster であるr の内容に設定します。Raster rは、BufferedImage と同じ座標空間にあるものと仮定されます。 |
void |
setRGB(int x, int y, int rgb)
この
BufferedImage のピクセルを、指定されたRGB値に設定します。 |
void |
setRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
デフォルトRGBカラー・モデル(TYPE_INT_ARGB)およびデフォルトsRGBカラー・スペースで、intピクセルの配列をイメージ・データの一部に設定します。
|
String |
toString()
この
BufferedImage オブジェクトおよびその値のString 表現を返します。 |
flush, getAccelerationPriority, getCapabilities, getScaledInstance, setAccelerationPriority
public static final int TYPE_CUSTOM
public static final int TYPE_INT_RGB
DirectColorModel
(アルファなし)を持ちます。不透明でないアルファを持つデータをこの型のイメージに格納する場合、AlphaComposite
のドキュメントの説明のとおりに、カラー・データをあらかじめ乗算されていない形式に調整し、アルファを破棄する必要があります。public static final int TYPE_INT_ARGB
DirectColorModel
(アルファあり)を持ちます。このイメージのカラー・データには、アルファがあらかじめ乗算されていません。この型がBufferedImage
コンストラクタへのimageType
引数として使用される場合、作成されるイメージはJDK 1.1以前のリリースで作成されるイメージと一貫性があります。public static final int TYPE_INT_ARGB_PRE
DirectColorModel
(アルファあり)を持ちます。このイメージのカラー・データには、アルファがあらかじめ乗算されています。public static final int TYPE_INT_BGR
DirectColorModel
を持ちます。不透明でないアルファを持つデータをこの型のイメージに格納する場合、AlphaComposite
のドキュメントの説明のとおりに、カラー・データをあらかじめ乗算されていない形式に調整し、アルファを破棄する必要があります。public static final int TYPE_3BYTE_BGR
ComponentColorModel
を持ちます。不透明でないアルファを持つデータをこの型のイメージに格納する場合、AlphaComposite
のドキュメントの説明のとおりに、カラー・データをあらかじめ乗算されていない形式に調整し、アルファを破棄する必要があります。public static final int TYPE_4BYTE_ABGR
ComponentColorModel
(アルファあり)を持ちます。このイメージのカラー・データには、アルファがあらかじめ乗算されていません。byteデータは、各ピクセルのbyteアドレスの小さい方からA、B、G、Rの順序で単一byte配列にインタリーブされます。public static final int TYPE_4BYTE_ABGR_PRE
ComponentColorModel
(アルファあり)を持ちます。このイメージのカラー・データには、アルファがあらかじめ乗算されています。byteデータは、各ピクセルのbyteアドレスの小さい方からA、B、G、Rの順序で単一byte配列にインタリーブされます。public static final int TYPE_USHORT_565_RGB
DirectColorModel
を持ちます。不透明でないアルファを持つデータをこの型のイメージに格納する場合、AlphaComposite
のドキュメントの説明のとおりに、カラー・データをあらかじめ乗算されていない形式に調整し、アルファを破棄する必要があります。public static final int TYPE_USHORT_555_RGB
DirectColorModel
を持ちます。不透明でないアルファを持つデータをこの型のイメージに格納する場合、AlphaComposite
のドキュメントの説明のとおりに、カラー・データをあらかじめ乗算されていない形式に調整し、アルファを破棄する必要があります。public static final int TYPE_BYTE_GRAY
ColorSpace
を持つComponentColorModel
を持ちます。不透明でないアルファを持つデータをこの型のイメージに格納する場合、AlphaComposite
のドキュメントの説明のとおりに、カラー・データをあらかじめ乗算されていない形式に調整し、アルファを破棄する必要があります。public static final int TYPE_USHORT_GRAY
ColorSpace
を持つComponentColorModel
を持ちます。不透明でないアルファを持つデータをこの型のイメージに格納する場合、AlphaComposite
のドキュメントの説明のとおりに、カラー・データをあらかじめ乗算されていない形式に調整し、アルファを破棄する必要があります。public static final int TYPE_BYTE_BINARY
IndexColorModel
(アルファなし)を持ちます。imageType
引数をとりColorModel
引数をとらないBufferedImage
コンストラクタのimageType
引数としてこの型を使用する場合、デフォルトのsRGB ColorSpace
にある2つの色({0, 0, 0}および{255, 255, 255})を持つIndexColorModel
で1ビット・イメージが作成されます。
適切なマップ・サイズのColorModel
を提供することにより、ColorModel
引数をとるBufferedImage
コンストラクタを介して、ピクセルあたりのビット数が2または4のイメージを構築します。
ピクセルあたりのビット数が8のイメージは、ColorModel
に応じてTYPE_BYTE_INDEXED
またはTYPE_BYTE_GRAY
を使用します。
色データをこの型のイメージに格納する場合、IndexColorModel
によって、カラー・マップのもっとも近い色が判断され、結果のインデックスが格納されます。IndexColorModel
カラー・マップの色によっては、アルファ成分または色成分の近似および損失が発生する可能性があります。
public static final int TYPE_BYTE_INDEXED
imageType
引数をとりColorModel
引数はとらないBufferedImage
コンストラクタのimageType
引数としてこの型が使用される場合、IndexColorModel
はデフォルトsRGB ColorSpaceの256色6/6/6カラー・キューブ・パレット(216 - 255以外の色はグレー・スケール値)で作成されます。
色データをこの型のイメージに格納する場合、IndexColorModel
によって、カラー・マップのもっとも近い色が判断され、結果のインデックスが格納されます。IndexColorModel
カラー・マップの色によっては、アルファ成分または色成分の近似および損失が発生する可能性があります。
public BufferedImage(int width, int height, int imageType)
BufferedImage
を構築します。イメージのColorSpace
は、デフォルトのsRGB領域になります。width
- 作成されたイメージの幅height
- 作成されたイメージの高さimageType
- 作成されたイメージの形式ColorSpace
, TYPE_INT_RGB
, TYPE_INT_ARGB
, TYPE_INT_ARGB_PRE
, TYPE_INT_BGR
, TYPE_3BYTE_BGR
, TYPE_4BYTE_ABGR
, TYPE_4BYTE_ABGR_PRE
, TYPE_BYTE_GRAY
, TYPE_USHORT_GRAY
, TYPE_BYTE_BINARY
, TYPE_BYTE_INDEXED
, TYPE_USHORT_565_RGB
, TYPE_USHORT_555_RGB
public BufferedImage(int width, int height, int imageType, IndexColorModel cm)
BufferedImage
を構築します。
イメージ型がTYPE_BYTE_BINARYの場合は、イメージのピクセルあたりのビット数(1、2、または4)の決定にカラー・モデル内のエントリ数が使用されます。カラー・モデル内のエントリ数が1または2の場合、イメージのピクセルあたりのビット数は1になり、エントリ数が3または4の場合は、2になります。エントリ数が5 - 16の場合は、4になります。そうでない場合は、IllegalArgumentExceptionがスローされます。
width
- 作成されたイメージの幅height
- 作成されたイメージの高さimageType
- 作成されたイメージの形式cm
- 作成されたイメージのIndexColorModel
IllegalArgumentException
- imageTypeがTYPE_BYTE_BINARYまたはTYPE_BYTE_INDEXEDでない場合、あるいはimageTypeがTYPE_BYTE_BINARYで、カラー・マップが16を超えるエントリを持つ場合。TYPE_BYTE_BINARY
, TYPE_BYTE_INDEXED
public BufferedImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable<?,?> properties)
ColorModel
とRaster
で新しいBufferedImage
を構築します。Raster
のSampleModel
のバンドの数および型が、色成分およびアルファ成分を表すためにColorModel
によって要求される数および型と一致しない場合は、RasterFormatException
がスローされます。このメソッドは、ColorModel
のalphaPremultiplied
状態と一致させるために色Raster
データをアルファで乗算または除算できます。このBufferedImage
のプロパティは、String
とObject
のペアのHashtable
を渡すことによって確立できます。cm
- 新しいイメージのColorModel
raster
- イメージ・データのRaster
isRasterPremultiplied
- true
の場合、ラスターのデータはアルファによってあらかじめ乗算されている。properties
- String
とObject
ペアのHashtable
。RasterFormatException
- Raster
のSampleModel
のバンド数および型が、色成分およびアルファ成分を表すためにColorModel
によって要求される数および型と一致しない場合。IllegalArgumentException
- raster
がcm
に対応していない場合ColorModel
、Raster
、WritableRaster
public int getType()
BufferedImage
のイメージ型。TYPE_INT_RGB
, TYPE_INT_ARGB
, TYPE_INT_ARGB_PRE
, TYPE_INT_BGR
, TYPE_3BYTE_BGR
, TYPE_4BYTE_ABGR
, TYPE_4BYTE_ABGR_PRE
, TYPE_BYTE_GRAY
, TYPE_BYTE_BINARY
, TYPE_BYTE_INDEXED
, TYPE_USHORT_GRAY
, TYPE_USHORT_565_RGB
, TYPE_USHORT_555_RGB
, TYPE_CUSTOM
public ColorModel getColorModel()
ColorModel
を返します。getColorModel
、インタフェース: RenderedImage
BufferedImage
のColorModel
。public WritableRaster getRaster()
WritableRaster
を返します。BufferedImage
のWriteableRaster
。public WritableRaster getAlphaRaster()
ColorModel
オブジェクト(ComponentColorModel
およびDirectColorModel
など)でBufferedImage
のアルファ・チャネルを表すWritableRaster
を返します。このイメージのColorModel
と関連したアルファ・チャネルがない場合にはnull
を返します。IndexColorModel
を除くすべてのColorModel
オブジェクトに関し、ColorModel
がアルファをサポートする場合、このメソッドは、イメージ・データの最後のバンドに別のアルファ・チャネルが格納されていると見なします。イメージがルックアップ表にアルファを持つIndexColorModel
を使用する場合、空間的に分離したアルファ・チャネルが存在しないため、このメソッドはnull
を返します。このメソッドは新しいWritableRaster
を作成しますが、データ配列は共有することになります。WritableRaster
。このBufferedImage
がColorModel
と関連したアルファ・チャネルを持たない場合はnull
。public int getRGB(int x, int y)
ColorModel
と一致しない場合には色変換が行われます。このメソッドを使用する場合、返されたデータの各色成分の精度はわずか8ビットです。
座標が境界内にない場合は、ArrayOutOfBoundsException
がスローされることがあります。ただし、明示的な境界チェックは必ずしも実行されません。
x
- デフォルトRGBカラー・モデルおよびsRGBカラー・スペースでの取得対象ピクセルのX座標y
- デフォルトRGBカラー・モデルおよびsRGBカラー・スペースでの取得対象ピクセルのY座標setRGB(int, int, int)
, setRGB(int, int, int, int, int[], int, int)
public int[] getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
ColorModel
と一致しない場合は色変換が行われます。このメソッドを使用する場合、返されたデータの各色成分の精度はわずか8ビットです。イメージの座標(x, y)を指定した場合、ARGBピクセルには次のようにしてアクセスできます。
pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)];
領域が境界内にない場合は、ArrayOutOfBoundsException
がスローされることがあります。ただし、明示的な境界チェックは必ずしも実行されません。
startX
- 始点のX座標startY
- 始点のY座標w
- 領域の幅h
- 領域の高さrgbArray
- null
でない場合、rgbピクセルはここに書き込まれるoffset
- rgbArray
へのオフセットscansize
- rgbArray
の走査線ストライドsetRGB(int, int, int)
, setRGB(int, int, int, int, int[], int, int)
public void setRGB(int x, int y, int rgb)
BufferedImage
のピクセルを、指定されたRGB値に設定します。ピクセルは、デフォルトRGBカラー・モデル(TYPE_INT_ARGB)およびデフォルトsRGBカラー・スペースにあると見なされます。IndexColorModel
を持つイメージの場合、もっとも近い色のインデックスが選択されます。
座標が境界内にない場合は、ArrayOutOfBoundsException
がスローされることがあります。ただし、明示的な境界チェックは必ずしも実行されません。
x
- 設定されるピクセルのX座標y
- 設定されるピクセルのY座標rgb
- RGB値getRGB(int, int)
, getRGB(int, int, int, int, int[], int, int)
public void setRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
ColorModel
と一致しない場合は色変換が行われます。このメソッドを使用する場合、返されたデータの各色成分の精度はわずか8ビットです。このイメージの座標(x, y)を指定した場合、ARGBピクセルには次のようにしてアクセスできます。
pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)];警告: ディザリングは行われません。
領域が境界内にない場合は、ArrayOutOfBoundsException
がスローされることがあります。ただし、明示的な境界チェックは必ずしも実行されません。
startX
- 始点のX座標startY
- 始点のY座標w
- 領域の幅h
- 領域の高さrgbArray
- rgbピクセルoffset
- rgbArray
へのオフセットscansize
- rgbArray
の走査線ストライドgetRGB(int, int)
, getRGB(int, int, int, int, int[], int, int)
public int getWidth()
BufferedImage
の幅を返します。getWidth
、インタフェース: RenderedImage
BufferedImage
の幅public int getHeight()
BufferedImage
の高さを返します。getHeight
、インタフェース: RenderedImage
BufferedImage
の高さpublic int getWidth(ImageObserver observer)
BufferedImage
の幅を返します。getWidth
、クラス: Image
observer
- 無視されるBufferedImage
の幅Image.getHeight(java.awt.image.ImageObserver)
、ImageObserver
public int getHeight(ImageObserver observer)
BufferedImage
の高さを返します。getHeight
、クラス: Image
observer
- 無視されるBufferedImage
の高さImage.getWidth(java.awt.image.ImageObserver)
、ImageObserver
public ImageProducer getSource()
getSource
、クラス: Image
ImageProducer
。ImageProducer
public Object getProperty(String name, ImageObserver observer)
UndefinedProperty
フィールドを返します。このイメージのプロパティが不明な場合、このメソッドはnull
を返し、ImageObserver
オブジェクトはあとで通知を受けます。プロパティ名「comment」は、イメージ、ソース、および作成者の説明としてユーザーに提示することができるオプションのコメントを格納するために使用されます。getProperty
、クラス: Image
name
- プロパティ名observer
- イメージ情報に関する通知を受け取るImageObserver
name
で表されるプロパティであるObject
、またはこのイメージのプロパティが定義されていない場合はnull
。NullPointerException
- プロパティ名がnullの場合。ImageObserver
、Image.UndefinedProperty
public Object getProperty(String name)
getProperty
、インタフェース: RenderedImage
name
- プロパティ名name
で表されるプロパティであるObject
。NullPointerException
- プロパティ名がnullの場合。Image.UndefinedProperty
public Graphics getGraphics()
getGraphics
、クラス: Image
Graphics2D
。Graphics
、Component.createImage(int, int)
public Graphics2D createGraphics()
BufferedImage
に描画するために使用できるGraphics2D
を作成します。Graphics2D
。public BufferedImage getSubimage(int x, int y, int w, int h)
BufferedImage
は、オリジナル・イメージと同じデータ配列を共有します。x
- 指定された矩形領域の左上隅のX座標y
- 指定された矩形領域の左上隅のY座標w
- 指定された矩形領域の幅h
- 指定された矩形領域の高さBufferedImage
のサブイメージを表すBufferedImage
。RasterFormatException
- 指定された領域がこのBufferedImage
内に含まれていない場合。public boolean isAlphaPremultiplied()
false
を返します。true
、そうでない場合はfalse
。public void coerceData(boolean isAlphaPremultiplied)
isAlphaPremultiplied
変数で指定された状態にデータを一致させます。このメソッドは、カラー・ラスター・データをアルファで乗算または除算します。データが正しい状態にある場合には、処理は行いません。isAlphaPremultiplied
- アルファがあらかじめ乗算されている場合はtrue
、そうでない場合はfalse
。public String toString()
BufferedImage
オブジェクトおよびその値のString
表現を返します。public Vector<RenderedImage> getSources()
BufferedImage
のイメージ・データの直接のソース(直接のソースのソースではありません)であるRenderedImage
オブジェクトのVector
を返します。BufferedImage
に直接のソースについての情報がない場合、このメソッドはnull
を返します。BufferedImage
が直接のソースを持たない場合は、空のVector
を返します。getSources
、インタフェース: RenderedImage
BufferedImage
オブジェクトのイメージ・データの直接のソースを格納しているVector
。このBufferedImage
が直接のソースについての情報を持たない場合はnull
。このBufferedImage
が直接のソースを持たない場合は空のVector
。public String[] getPropertyNames()
getProperty(String)
が認識する名前の配列を返すか、プロパティ名が認識されない場合はnull
を返します。getPropertyNames
、インタフェース: RenderedImage
getProperty(String)
が認識するすべてのプロパティ名を含むString
配列。プロパティ名が認識されない場合はnull
。public int getMinX()
BufferedImage
の最小x座標を返します。これは常に0になります。getMinX
、インタフェース: RenderedImage
BufferedImage
の最小x座標。public int getMinY()
BufferedImage
の最小y座標を返します。これは常に0になります。getMinY
、インタフェース: RenderedImage
BufferedImage
の最小y座標。public SampleModel getSampleModel()
BufferedImage
に関連付けられたSampleModel
を返します。getSampleModel
、インタフェース: RenderedImage
BufferedImage
のSampleModel
。public int getNumXTiles()
getNumXTiles
、インタフェース: RenderedImage
public int getNumYTiles()
getNumYTiles
、インタフェース: RenderedImage
public int getMinTileX()
getMinTileX
、インタフェース: RenderedImage
public int getMinTileY()
getMinTileY
、インタフェース: RenderedImage
public int getTileWidth()
getTileWidth
、インタフェース: RenderedImage
public int getTileHeight()
getTileHeight
、インタフェース: RenderedImage
public int getTileGridXOffset()
getTileGridXOffset
、インタフェース: RenderedImage
public int getTileGridYOffset()
getTileGridYOffset
、インタフェース: RenderedImage
public Raster getTile(int tileX, int tileY)
tileX
, tileY
)を返します。tileX
およびtileY
はタイル配列内でのインデックスであり、ピクセル位置ではありません。返されるRaster
はアクティブであり、イメージが変更されると更新されます。getTile
、インタフェース: RenderedImage
tileX
- タイル配列にある要求されたタイルのxインデックスtileY
- タイル配列にある要求されたタイルのyインデックスtileX
およびtileY
引数で定義されるタイルを表すRaster
。ArrayIndexOutOfBoundsException
- tileX
とtileY
の両方が0でない場合public Raster getData()
Raster
はイメージ・データのコピーであり、イメージが変更されても更新されません。getData
、インタフェース: RenderedImage
Raster
。setData(Raster)
public Raster getData(Rectangle rect)
BufferedImage
の任意の領域を計算して返します。返されたRaster
はイメージ・データのコピーであり、イメージが変更されても更新されません。getData
、インタフェース: RenderedImage
rect
- 返されるBufferedImage
の領域。BufferedImage
の指定された領域のイメージ・データのコピーであるRaster
setData(Raster)
public WritableRaster copyData(WritableRaster outRaster)
BufferedImage
の任意の矩形領域を計算し、指定されたWritableRaster
にコピーします。計算される領域は、指定されたWritableRaster
の境界から決まります。指定されたWritableRaster
は、このイメージと互換性のあるSampleModel
を持つ必要があります。outRaster
がnull
の場合は、適切なWritableRaster
が作成されます。copyData
、インタフェース: RenderedImage
outRaster
- イメージの返された部分を保持するWritableRaster
、またはnull
WritableRaster
への参照。public void setData(Raster r)
Raster
であるr
の内容に設定します。Raster rは、BufferedImage
と同じ座標空間にあるものと仮定されます。このオペレーションは、BufferedImage
の境界にクリッピングされます。setData
、インタフェース: WritableRenderedImage
r
- 指定されたRaster
getData()
, getData(Rectangle)
public void addTileObserver(TileObserver to)
addTileObserver
、インタフェース: WritableRenderedImage
to
- 指定されたTileObserver
public void removeTileObserver(TileObserver to)
removeTileObserver
、インタフェース: WritableRenderedImage
to
- 指定されたTileObserver
。public boolean isTileWritable(int tileX, int tileY)
isTileWritable
、インタフェース: WritableRenderedImage
tileX
- タイルのxインデックス。tileY
- タイルのyインデックス。true
、そうでない場合はfalse
。ArrayIndexOutOfBoundsException
- tileX
とtileY
の両方が0でない場合public Point[] getWritableTileIndices()
Point
オブジェクトの配列を返します。チェック・アウトされているタイルがない場合はnull
を返します。getWritableTileIndices
、インタフェース: WritableRenderedImage
Point
配列。書込み用にチェック・アウトされているタイルがない場合はnull
。public boolean hasTileWriters()
(getWritableTileIndices() != null).
hasTileWriters
、インタフェース: WritableRenderedImage
true
、そうでない場合はfalse
。public WritableRaster getWritableTile(int tileX, int tileY)
TileObservers
が通知を受けます。getWritableTile
、インタフェース: WritableRenderedImage
tileX
- タイルのxインデックスtileY
- タイルのyインデックスWritableRaster
。public void releaseWritableTile(int tileX, int tileY)
getWritableTile(int, int)
とペアで呼び出す必要があります。それ以外の方法では結局、結果が未定義となります。タイルが1つのライターを持つ状態からライターなしの状態に変わるときは、登録されたすべてのTileObservers
が通知を受けます。releaseWritableTile
、インタフェース: WritableRenderedImage
tileX
- タイルのxインデックスtileY
- タイルのyインデックスpublic int getTransparency()
getTransparency
、インタフェース: Transparency
BufferedImage
の透明度。Transparency.OPAQUE
, Transparency.BITMASK
, Transparency.TRANSLUCENT
バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2016, Oracle and/or its affiliates. All rights reserved.Use is subject to license termsDocumentation Redistribution Policyも参照してください。