Image Class Reference

#include <Image.h>

Inherited by PNGImage.

Inheritance diagram for Image:

Inheritance graph
[legend]
Collaboration diagram for Image:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Image (int resX, int resY)
virtual ~Image ()
int width () const
int height () const
const RGBAColorpixel (int x, int y) const
void setPixel (const RGBAColor &p, int x, int y)
virtual bool read (const std::string &fileName)=0
virtual void write (const std::string &fileName) const=0

Protected Attributes

int mResX
 X resolution.
int mResY
 Y resolution.
RGBAColormPixels
 Array with color values of all pixels.

Detailed Description

Abstract class representing a 2D image

Author:
Christian Engels

Alex Busenius

Definition at line 16 of file Image.h.


Constructor & Destructor Documentation

Image::Image ( int  resX,
int  resY 
)

Constructor

Parameters:
resX X resolution
resY Y resolution

Definition at line 13 of file Image.cpp.

References mPixels.

Image::~Image (  )  [virtual]

Destructor

Definition at line 23 of file Image.cpp.

References mPixels.


Member Function Documentation

int Image::width (  )  const [inline]

Get image dimension x

Definition at line 32 of file Image.h.

References mResX.

Referenced by Texture2D::Texture2D().

int Image::height (  )  const [inline]

Get image dimension y

Definition at line 39 of file Image.h.

References mResY.

Referenced by Texture2D::Texture2D().

const RGBAColor & Image::pixel ( int  x,
int  y 
) const

Get pixel value on certain position

Definition at line 31 of file Image.cpp.

References mPixels, mResX, and mResY.

Referenced by Texture2D::wrappedTexel(), and PNGImage::write().

void Image::setPixel ( const RGBAColor p,
int  x,
int  y 
)

Set pixel on certain position

Definition at line 43 of file Image.cpp.

References mPixels, mResX, and mResY.

Referenced by PNGImage::read(), and Renderer::renderFromTo().

virtual bool Image::read ( const std::string &  fileName  )  [pure virtual]

Read image from a file. The image will be converted to float r, g, b, a

Parameters:
fileName File name to read from
Returns:
true if successfull

Implemented in PNGImage.

Referenced by Texture2D::Texture2D().

virtual void Image::write ( const std::string &  fileName  )  const [pure virtual]

Write image content to a file.

Parameters:
fileName File name to write to

Implemented in PNGImage.


Member Data Documentation

int Image::mResX [protected]

X resolution.

Definition at line 67 of file Image.h.

Referenced by pixel(), PNGImage::read(), setPixel(), width(), and PNGImage::write().

int Image::mResY [protected]

Y resolution.

Definition at line 70 of file Image.h.

Referenced by height(), pixel(), PNGImage::read(), setPixel(), and PNGImage::write().

RGBAColor* Image::mPixels [protected]

Array with color values of all pixels.

Definition at line 73 of file Image.h.

Referenced by Image(), pixel(), PNGImage::read(), setPixel(), and ~Image().


The documentation for this class was generated from the following files:
Generated on Fri Feb 1 00:02:18 2008 for Grayfall by  doxygen 1.5.1