#include <Image.h>
Inherited by PNGImage.
Inheritance diagram for Image:
Public Member Functions | |
Image (int resX, int resY) | |
virtual | ~Image () |
int | width () const |
int | height () const |
const RGBAColor & | pixel (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. | |
RGBAColor * | mPixels |
Array with color values of all pixels. |
Definition at line 16 of file Image.h.
Image::Image | ( | int | resX, | |
int | resY | |||
) |
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
fileName | File name to read from |
Implemented in PNGImage.
Referenced by Texture2D::Texture2D().
virtual void Image::write | ( | const std::string & | fileName | ) | const [pure virtual] |
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().