scImageHandler.dll
 全て クラス 名前空間 関数 変数 列挙値
公開メンバ関数 | 限定公開メンバ関数 | 限定公開変数類 | 全メンバ一覧
scMetaImg クラス

抽象画像データを扱うためのクラス [詳解]

#include <scMetaImg.h>

公開メンバ関数

 scMetaImg ()
 
virtual ‾scMetaImg ()
 
scMetaImgoperator= (const scMetaImg &rhs)
 
int Width () const
 
int Height () const
 
int Bit () const
 
int Channel () const
 
SC_METAIMG_PALETTEPalette ()
 
const SC_METAIMG_PALETTECstPalette () const
 
int PaletteSize () const
 
int Resize (int width, int height, int bit, int channel)
 
int Resize (const scMetaImg *ref_img)
 
void * ImgPtr (int index) const
 
unsigned char * ImgPtr08 (int index) const
 
unsigned short * ImgPtr16 (int index) const
 
const unsigned char * CstImgPtr08 (int index) const
 
const unsigned short * CstImgPtr16 (int index) const
 
unsigned char ** ImgPtr08_2d () const
 
unsigned short ** ImgPtr16_2d () const
 
const unsigned char ** CstImgPtr08_2d () const
 
const unsigned short ** CstImgPtr16_2d () const
 

限定公開メンバ関数

 scMetaImg (const scMetaImg &rhs)
 
void * MemCpy__ (void *buf1, const void *buf2, int byte_size)
 

限定公開変数類

void * buf1d_
 
void ** buf2d_
 
int width_
 
int height_
 
int bit_
 
int channel_
 
SC_METAIMG_PALETTEary_palette_
 
int palette_size_
 

詳解

抽象画像データを扱うためのクラス

このクラスは、抽象画像データを扱うための機能を提供する。 画素データは void型配列 によって格納される。 画素データが格納されるメモリは、コンストラクタ、代入、Resize 関数によって自動的に確保される。 代入、Resize 関数によって元の配列は破棄され、画素格納アドレスが変更されることに留意すること。

構築子と解体子

scMetaImg::scMetaImg ( const scMetaImg rhs)
protected

コピーコンストラクタ

scMetaImg::scMetaImg ( )
inline

コンストラクタ

関数詳解

int scMetaImg::Bit ( ) const
inline
戻り値
単色のビット数を帰す。
int scMetaImg::Channel ( ) const
inline
戻り値
色数を帰す。
const unsigned char* scMetaImg::CstImgPtr08 ( int  index) const
inline
引数
[in]index色の指定
戻り値
指定した色の画素データの先頭アドレスを const unsigned char * で帰す。
const unsigned char** scMetaImg::CstImgPtr08_2d ( ) const
inline
戻り値
各色の画素データの先頭アドレスを const unsigned char ** で帰す。
const unsigned short* scMetaImg::CstImgPtr16 ( int  index) const
inline
引数
[in]index色の指定
戻り値
指定した色の画素データの先頭アドレスを const unsigned short * で帰す。
const unsigned short** scMetaImg::CstImgPtr16_2d ( ) const
inline
戻り値
各色の画素データの先頭アドレスを const unsigned short ** で帰す。
const SC_METAIMG_PALETTE* scMetaImg::CstPalette ( ) const
inline
戻り値
パレットのアドレスを const SC_METAIMG_PALETTE * で帰す。
int scMetaImg::Height ( ) const
inline
戻り値
画像高さを帰す。
void* scMetaImg::ImgPtr ( int  index) const
inline
引数
[in]index色の指定
戻り値
指定した色の画素データの先頭アドレスを void * で帰す。
unsigned char* scMetaImg::ImgPtr08 ( int  index) const
inline
引数
[in]index色の指定
戻り値
指定した色の画素データの先頭アドレスを unsigned char * で帰す。
unsigned char** scMetaImg::ImgPtr08_2d ( ) const
inline
戻り値
各色の画素データの先頭アドレスを unsigned char ** で帰す。
unsigned short* scMetaImg::ImgPtr16 ( int  index) const
inline
引数
[in]index色の指定
戻り値
指定した色の画素データの先頭アドレスを unsigned short * で帰す。
unsigned short** scMetaImg::ImgPtr16_2d ( ) const
inline

各色の画素データの先頭アドレスを unsigned short ** で帰す。

void* scMetaImg::MemCpy__ ( void *  buf1,
const void *  buf2,
int  byte_size 
)
inlineprotected

メモリコピー

scMetaImg& scMetaImg::operator= ( const scMetaImg rhs)
inline

代入演算子 自分自身への代入を指定された場合、何もしない。

SC_METAIMG_PALETTE* scMetaImg::Palette ( )
inline
戻り値
パレットのアドレスを帰す。
int scMetaImg::PaletteSize ( ) const
inline
戻り値
パレットサイズ(個数)を帰す。
int scMetaImg::Resize ( int  width,
int  height,
int  bit,
int  channel 
)
inline

画像情報の更新とメモリの確保を行なう。 関数呼び出し前の画素データは破棄される。 メモリサイズ( buf_size、バイト数 )は、以下のように算出される。 ※DLLで構築したインスタンスは、このメンバ関数を実行してはならない。

pix_size = width * height;
plane_size = pix_size * ( ( bit + 7 ) >> 3 );
buf_size = plane_size * channel;
引数
[in]width新しい画像の幅
[in]height新しい画像の高さ
[in]bit新しい画像の単色のビット数
[in]channel新しい画像の色数
戻り値
成功した場合、0 を帰す。失敗した場合、0 以外を帰す。
int scMetaImg::Resize ( const scMetaImg ref_img)
inline

入力したscMetaImg型変数を参照し、画像情報と更新とメモリの確保を行なう。 画像情報とメモリサイズは、参照するインスタンスと同じになる。 関数呼び出し前の画素データは破棄される。 ※DLLで構築したインスタンスは、このメンバ関数を実行してはならない。

引数
[in]ref_img参照するscMetaImg型変数のポインタ
戻り値
成功した場合、0 を帰す。失敗した場合、0 以外を帰す。
int scMetaImg::Width ( ) const
inline
戻り値
画像幅を帰す。
virtual scMetaImg::‾scMetaImg ( )
inlinevirtual

デストラクタ buf1d_、buf2d_ がNULLでは無い場合、これらを解放する。

メンバ詳解

SC_METAIMG_PALETTE* scMetaImg::ary_palette_
protected

パレット

int scMetaImg::bit_
protected

単色1画素の情報量

現状では、1bit、8 bit、16 bit のみサポートしている。

void* scMetaImg::buf1d_
protected

画素データを格納するバッファの先頭アドレス。 各色の画素データが面順次でシーケンシャルに格納される。 画像原点は左上。

ラインデータのサイズは、1バイトの倍数でなければならない。 line_bytesize = ( width * bit + 7 ) / 8 width : 横方向の画素数 bit : 単色1画素の情報量

void** scMetaImg::buf2d_
protected

画素データの各色の先頭アドレス

int scMetaImg::channel_
protected

色数 RGB画像なら色数=3、インデックスカラーなら色数=1

int scMetaImg::height_
protected

画像の高さ

int scMetaImg::palette_size_
protected

パレットサイズ

int scMetaImg::width_
protected

画像の幅


このクラス詳解は次のファイルから抽出されました: