jp.hishidama.bitmap
クラス BitmapInfoColors

java.lang.Object
  上位を拡張 jp.hishidama.bitmap.BitmapInfoColors

public class BitmapInfoColors
extends Object

ビットマップ用パレット

作成者:
ひしだま

コンストラクタの概要
BitmapInfoColors(int cnt)
          コンストラクタ
 
メソッドの概要
 int getBytesLength()
          パレットのファイルへの保存用のバイト数を返す
 int getColor(int rgb)
          RGBに対する色コードを返す
(パレットの中から近いものを探して返す)
 int getCount()
          パレットの個数を返す
 byte[] getPalBytes()
          パレットのファイルへの保存用のバイト列を返す
 int getRGB(int c)
          色コードに対するRGBを返す
static int getRGB(int r, int g, int b)
          3原色からRGBを返す
static int getRgbB(int rgb)
          RGBの青要素を返す
static int getRgbG(int rgb)
          RGBの緑要素を返す
static int getRgbR(int rgb)
          RGBの赤要素を返す
 void init(byte[] data)
          パレットをファイルのバイト列から初期化する
 void setPalet(int c, int r, int g, int b)
          パレットを設定する
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

BitmapInfoColors

public BitmapInfoColors(int cnt)
コンストラクタ

パラメータ:
cnt - パレット数
メソッドの詳細

getCount

public int getCount()
パレットの個数を返す

戻り値:
パレット数

getRGB

public int getRGB(int c)
色コードに対するRGBを返す

パラメータ:
c - 色コード
戻り値:
RGB

getColor

public int getColor(int rgb)
RGBに対する色コードを返す
(パレットの中から近いものを探して返す)

パラメータ:
rgb - RGB
戻り値:
色コード

setPalet

public void setPalet(int c,
                     int r,
                     int g,
                     int b)
パレットを設定する

パラメータ:
c - 色コード
r - 赤要素(0〜255)
g - 緑要素(0〜255)
b - 青要素(0〜255)

getRGB

public static int getRGB(int r,
                         int g,
                         int b)
3原色からRGBを返す

パラメータ:
r - 赤要素(0〜255)
g - 緑要素(0〜255)
b - 青要素(0〜255)
戻り値:
RGB

getRgbR

public static int getRgbR(int rgb)
RGBの赤要素を返す

パラメータ:
rgb - RGB
戻り値:
赤要素(0〜255)

getRgbG

public static int getRgbG(int rgb)
RGBの緑要素を返す

パラメータ:
rgb - RGB
戻り値:
緑要素(0〜255)

getRgbB

public static int getRgbB(int rgb)
RGBの青要素を返す

パラメータ:
rgb - RGB
戻り値:
青要素(0〜255)

getPalBytes

public byte[] getPalBytes()
パレットのファイルへの保存用のバイト列を返す

戻り値:
バイト列

getBytesLength

public int getBytesLength()
パレットのファイルへの保存用のバイト数を返す

戻り値:
バイト列の長さ(バイト単位)

init

public void init(byte[] data)
パレットをファイルのバイト列から初期化する

パラメータ:
data - バイト列