TGAImage Class Reference

#include <TgaTool.h>

List of all members.

Public Member Functions

 TGAImage (void)
virtual ~TGAImage (void)
void init (void)
 グラフィックデータは解放しない
bool isNull (void)
 グラフィックデータを持っていないか?
void clear (void)
 全空間を画素値 0 にする
void fill (uByte v=(uByte) 0)
 全空間を画素値 v にする
void free (void)
 グラフィックデータを開放する
uBytepoint (int x, int y, int c)
void getm (int x, int y, int c)
void set (int x, int y, int c)

Public Attributes

int xs
int ys
int col
int state
uByte hd [TGA_HEADER_SIZE]
uBytegp

Detailed Description

Definition at line 25 of file TgaTool.h.


Constructor & Destructor Documentation

TGAImage ( void   )  [inline]

Definition at line 37 of file TgaTool.h.

References TGAImage::init().

00037 { init();}

Here is the call graph for this function:

virtual ~TGAImage ( void   )  [inline, virtual]

Definition at line 38 of file TgaTool.h.

00038 {}


Member Function Documentation

void clear ( void   ) 

void TGAImage::clear(void)

Definition at line 50 of file TgaTool.cpp.

References TGAImage::col, TGAImage::gp, TGAImage::xs, and TGAImage::ys.

00051 {
00052     memset(gp, 0, xs*ys*col);
00053     return;
00054 }

void fill ( uByte  v = (uByte)0  ) 

void TGAImage::fill(uByte v)

Definition at line 60 of file TgaTool.cpp.

References TGAImage::col, TGAImage::gp, TGAImage::xs, and TGAImage::ys.

00061 {
00062     int i;
00063     for (i=0; i<xs*ys*col; i++) gp[i] = v;
00064 
00065     return;
00066 }

void free ( void   ) 

void TGAImage::free(void)

グラフィックデータを開放する

Definition at line 74 of file TgaTool.cpp.

References TGAImage::gp, and TGAImage::init().

Referenced by jbxl::MSGraph2TGAImage(), and jbxl::readTGAData().

00075 {  
00076     if (gp!=NULL) ::free(gp); 
00077     init();
00078 
00079     return;
00080 }

Here is the call graph for this function:

Here is the caller graph for this function:

void getm ( int  x,
int  y,
int  c 
)

void TGAImage::getm(int x, int y, int c)

Definition at line 105 of file TgaTool.cpp.

References TGAImage::gp, JBXL_GRAPH_MEMORY_ERROR, and TGAImage::state.

Referenced by TGAImage::set().

00106 {
00107     gp = (uByte*)malloc(x*y*c);
00108     if (gp==NULL) {
00109         state = JBXL_GRAPH_MEMORY_ERROR;
00110         return;
00111     }
00112     
00113     return;
00114 }

Here is the caller graph for this function:

void init ( void   ) 

void TGAImage::init(void)

メンバ変数を初期化する.

Definition at line 22 of file TgaTool.cpp.

References TGAImage::col, TGAImage::gp, TGAImage::hd, TGAImage::state, TGA_HEADER_SIZE, TGAImage::xs, and TGAImage::ys.

Referenced by TGAImage::free(), and TGAImage::TGAImage().

00023 { 
00024     xs      = 0;
00025     ys      = 0;
00026     col     = 0; 
00027     state   = 0;
00028     gp      = NULL;
00029 
00030     memset(hd, 0, TGA_HEADER_SIZE);
00031     return;
00032 }

Here is the caller graph for this function:

bool isNull ( void   ) 

bool TGAImage::isNull(void)

グラフィックデータを持いないか?

Definition at line 40 of file TgaTool.cpp.

References TGAImage::gp.

Referenced by jbxl::MSGraph2TGAImage(), and jbxl::TGAImage2MSGraph().

00041 {   
00042     if (gp==NULL) return true; 
00043     return false;
00044 }

Here is the caller graph for this function:

uByte& point ( int  x,
int  y,
int  c 
) [inline]

Definition at line 46 of file TgaTool.h.

References TGAImage::col, TGAImage::gp, and TGAImage::xs.

Referenced by jbxl::MSGraph2TGAImage(), and jbxl::TGAImage2MSGraph().

00046 { return gp[col*(y*xs + x) + c];}

Here is the caller graph for this function:

void set ( int  x,
int  y,
int  c 
)

void TGAImage::set(int x, int y, int c)

Definition at line 86 of file TgaTool.cpp.

References TGAImage::col, TGAImage::getm(), TGAImage::gp, TGAImage::state, TGAImage::xs, and TGAImage::ys.

Referenced by jbxl::MSGraph2TGAImage().

00087 { 
00088     getm(x, y, c); 
00089     if (gp==NULL) return;
00090 
00091     xs  = x;
00092     ys  = y;
00093     col = c;
00094     state = 0;
00095 
00096     memset(gp, 0, xs*ys*col);
00097 
00098     return;
00099 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int col
uByte hd[TGA_HEADER_SIZE]

Definition at line 33 of file TgaTool.h.

Referenced by TGAImage::init(), and jbxl::writeTGAData().

int state
int xs
int ys

The documentation for this class was generated from the following files:

Generated on 15 Nov 2023 for JunkBox_Lib++ (for Windows) by  doxygen 1.6.1