Back to index

extremetuxracer  0.5beta
Public Member Functions | Static Public Member Functions | Public Attributes
pp::Image Class Reference

#include <image.h>

Inheritance diagram for pp::Image:
Inheritance graph

List of all members.

Public Member Functions

 Image (int width=0, int height=0, int depth=3)
 ~Image (void)
bool writeToFile (const char *fileName) const

Static Public Member Functions

static ImagereadFile (const char *fileName)

Public Attributes

unsigned short width
unsigned short height
unsigned char depth
unsigned char * data

Detailed Description

Definition at line 24 of file image.h.

Constructor & Destructor Documentation

pp::Image::Image ( int  width = 0,
int  height = 0,
int  depth = 3 

Definition at line 31 of file image.cpp.

       if(width>0 && height>0 && depth>0 && depth <4){ 
              this->data=new unsigned char[width*height*depth];
pp::Image::~Image ( void  )

Definition at line 48 of file image.cpp.

       if(data!=0) delete data;    

Member Function Documentation

Image * pp::Image::readFile ( const char *  fileName) [static]

Definition at line 54 of file image.cpp.

       int len = strlen(fileName);
       // PNG Image?
              Image* image=new ReaderPNG(fileName);
              // check if the image contains valid data
                     return image;        
              } else {
                     delete image;
                     return NULL;
              // try it as rgb (should we check for this first?)
              Image* image=new ReaderRGB(fileName);
              return image;        

Here is the caller graph for this function:

bool pp::Image::writeToFile ( const char *  fileName) const

Definition at line 77 of file image.cpp.

       WriterPPM writer(fileName,*this);
       return true;

Here is the caller graph for this function:

Member Data Documentation

unsigned char* pp::Image::data

Definition at line 32 of file image.h.

unsigned char pp::Image::depth

Definition at line 31 of file image.h.

unsigned short pp::Image::height

Definition at line 30 of file image.h.

unsigned short pp::Image::width

Definition at line 30 of file image.h.

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