Public Member Functions

mxgui::TgaImage Class Reference
[Mxgui level 1]

#include <tga_image.h>

Inherits mxgui::basic_image_base< unsigned short >.

List of all members.

Public Member Functions

 TgaImage ()
 TgaImage (const char *filename)
 TgaImage (const TgaImage &rhs)
const TgaImageoperator= (const TgaImage &rhs)
void open (const char *filename)
void close ()
bool isOpen () const
virtual bool getScanLine (mxgui::Point p, mxgui::Color colors[], unsigned short length) const
virtual ~TgaImage ()

Detailed Description

This is a class for handling .tga images stored on disk. It is optimized for memory usage, so that it can used on arbitrary sized images on microcontrollers. To do this it does not load the image on disk and only fseeks around as needed. The obvious drawback is that it is heavy on disk bandwidth, but there's no other way to do that when you don't have enough RAM

Constructor & Destructor Documentation

mxgui::TgaImage::TgaImage (  )  [inline]

Default constructor

mxgui::TgaImage::TgaImage ( const char *  filename  )  [inline, explicit]

Construct from a filename

filename file name of tga image
mxgui::TgaImage::TgaImage ( const TgaImage rhs  )  [inline]

Copy constructor

rhs instance to copy from
virtual mxgui::TgaImage::~TgaImage (  )  [inline, virtual]


Member Function Documentation

void mxgui::TgaImage::close (  ) 

Close tga file

bool mxgui::TgaImage::getScanLine ( mxgui::Point  p,
mxgui::Color  colors[],
unsigned short  length 
) const [virtual]

Get pixels from tha image. This member function can be used to get up to a full horizontal line of pixels from an image.

p Start point, within <0,0> and <getWidth()-1,getHeight()-1>
colors pixel data is returned here. Array size must be equal to the length parameter
length number of pixel to retrieve from the starting point. start.x()+length must be less or equal to getWidth()
true if success. If false then it means the class does not represent a valid image, or a disk error occurred in case the image is stored on disk.

Reimplemented from mxgui::basic_image_base< T >.

bool mxgui::TgaImage::isOpen (  )  const [inline]
true if image is open
void mxgui::TgaImage::open ( const char *  filename  ) 

Open a tga file

filename file name of tga image
const TgaImage& mxgui::TgaImage::operator= ( const TgaImage rhs  )  [inline]

Operator =

rhs instance to copy from
reference to *this

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