jp.hishidama.bitmap
クラス AbstractBitmap

java.lang.Object
  上位を拡張 jp.hishidama.bitmap.AbstractBitmap
すべての実装されたインタフェース:
Bitmap
直系の既知のサブクラス:
AbstractPaletteBitmap, Bitmap16, Bitmap24

public abstract class AbstractBitmap
extends Object
implements Bitmap

ビットマップのスーパークラス

作成者:
ひしだま

フィールドの概要
 
インタフェース jp.hishidama.bitmap.Bitmap から継承されたフィールド
INVALID_COLOR
 
コンストラクタの概要
AbstractBitmap(BitmapInfoHeader bi)
           
AbstractBitmap(int nx, int ny)
           
 
メソッドの概要
static int calcPitch(int bitCount, int width)
          ピッチを計算する
 void copy(int dx, int dy, int nx, int ny, Bitmap src, int sx, int sy)
          画像をコピーする
 boolean fill(int sx, int sy, int nx, int ny, int c)
          塗り潰す
 int get(int x, int y)
          指定された座標の色コードを返す
 int getB(int c)
          色コードの青要素を返す
 BitmapInfoHeader getBitmapInfoHeader()
           
 int getColor(int r, int g, int b)
          (r,g,b)に該当する色コードを返す
 int getG(int c)
          色コードの緑要素を返す
 BitmapInfoColors getPalets()
           
 int getPitch()
          当ビットマップのピッチを返す
 int getR(int c)
          色コードの赤要素を返す
abstract  int getRGB(int c)
          色コードのRGBを返す
 int getRGB(int x, int y)
          指定された座標のRGBを返す
 boolean line(int sx, int sy, int nx, int ny, int c)
          線を引く
 boolean save(FileOutputStream output)
          ファイルへ保存する
 boolean save(String pathName, String fileName)
          ファイルへ保存
 boolean set(int x, int y, int c)
          指定された座標に色コードをセットする
 boolean setRGB(int x, int y, int rgb)
          指定された座標にRGBをセットする
 boolean validColor(int c)
          指定された色コードが正当かどうか判定する
 boolean validPos(int x, int y)
          指定された座標が範囲内かどうか判定する
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース jp.hishidama.bitmap.Bitmap から継承されたメソッド
get0, getColor, set0
 

コンストラクタの詳細

AbstractBitmap

public AbstractBitmap(int nx,
                      int ny)
パラメータ:
nx -
ny -

AbstractBitmap

public AbstractBitmap(BitmapInfoHeader bi)
パラメータ:
bi -
メソッドの詳細

validPos

public boolean validPos(int x,
                        int y)
指定された座標が範囲内かどうか判定する

定義:
インタフェース Bitmap 内の validPos
パラメータ:
x -
y -
戻り値:
true:範囲内

validColor

public boolean validColor(int c)
指定された色コードが正当かどうか判定する

定義:
インタフェース Bitmap 内の validColor
パラメータ:
c -
戻り値:
true:正当

set

public boolean set(int x,
                   int y,
                   int c)
指定された座標に色コードをセットする

定義:
インタフェース Bitmap 内の set
パラメータ:
x -
y -
c - 色コード
戻り値:
成功した場合、true

get

public int get(int x,
               int y)
指定された座標の色コードを返す

定義:
インタフェース Bitmap 内の get
パラメータ:
x -
y -
戻り値:
色コード

setRGB

public boolean setRGB(int x,
                      int y,
                      int rgb)
指定された座標にRGBをセットする

定義:
インタフェース Bitmap 内の setRGB
パラメータ:
x -
y -
rgb -
戻り値:
成功した場合、true

getRGB

public int getRGB(int x,
                  int y)
指定された座標のRGBを返す

定義:
インタフェース Bitmap 内の getRGB
パラメータ:
x -
y -
戻り値:
RGB

getRGB

public abstract int getRGB(int c)
色コードのRGBを返す

定義:
インタフェース Bitmap 内の getRGB
パラメータ:
c - 色コード
戻り値:
RGB

getR

public int getR(int c)
色コードの赤要素を返す

パラメータ:
c - 色コード
戻り値:
R(0〜255)

getG

public int getG(int c)
色コードの緑要素を返す

パラメータ:
c - 色コード
戻り値:
G(0〜255)

getB

public int getB(int c)
色コードの青要素を返す

パラメータ:
c - 色コード
戻り値:
B(0〜255)

getColor

public int getColor(int r,
                    int g,
                    int b)
(r,g,b)に該当する色コードを返す

定義:
インタフェース Bitmap 内の getColor
パラメータ:
r - (0〜255)
g - (0〜255)
b - (0〜255)
戻り値:
色コード

fill

public boolean fill(int sx,
                    int sy,
                    int nx,
                    int ny,
                    int c)
塗り潰す

定義:
インタフェース Bitmap 内の fill
パラメータ:
sx - 始点X
sy - 始点Y
nx - サイズX
ny - サイズY
c - 色コード
戻り値:
成功した場合、true

line

public boolean line(int sx,
                    int sy,
                    int nx,
                    int ny,
                    int c)
線を引く

定義:
インタフェース Bitmap 内の line
パラメータ:
sx - 始点X
sy - 始点Y
nx - サイズX
ny - サイズY
c - 色コード
戻り値:
成功した場合、true

copy

public void copy(int dx,
                 int dy,
                 int nx,
                 int ny,
                 Bitmap src,
                 int sx,
                 int sy)
画像をコピーする

定義:
インタフェース Bitmap 内の copy
パラメータ:
dx - コピー先座標X
dy - コピー先座標Y
nx - コピーサイズX
ny - コピーサイズY
src - コピー元のビットマップ
sx - コピー元左上座標X
sy - コピー元左上座標Y

getPitch

public int getPitch()
当ビットマップのピッチを返す

定義:
インタフェース Bitmap 内の getPitch
戻り値:
ピッチ

calcPitch

public static int calcPitch(int bitCount,
                            int width)
ピッチを計算する

パラメータ:
bitCount -
width -
戻り値:
ピッチ

save

public boolean save(String pathName,
                    String fileName)
ファイルへ保存

定義:
インタフェース Bitmap 内の save
パラメータ:
pathName - パス名
fileName - ファイル名
戻り値:
成功した場合、true

save

public boolean save(FileOutputStream output)
ファイルへ保存する

パラメータ:
output -
戻り値:
成功した場合、true

getBitmapInfoHeader

public BitmapInfoHeader getBitmapInfoHeader()
定義:
インタフェース Bitmap 内の getBitmapInfoHeader
戻り値:
ビットマップヘッダー情報

getPalets

public BitmapInfoColors getPalets()
定義:
インタフェース Bitmap 内の getPalets
戻り値:
パレット