Manged image data (see ManagedData).
More...
#include <image.h>
|
| ImageData () |
| Constructor.
|
|
| ~ImageData () |
| Destructor.
|
|
int | getWidth () const |
| Returns the width of the image (in pixels). More...
|
|
int | getHeight () const |
| Returns the height of the image (in pixels). More...
|
|
int | getBpp () const |
| Reports the bits per pixel. More...
|
|
void | initGL () const |
| Initializes the image for drawing in an OpenGL context.
|
|
void | drawGL () const |
| Draws the image onto a quad, centered on the origin of the x-y plane.
|
|
void | bind () const |
| Binds the image to use as a texture in OpenGL.
|
|
unsigned char | getPixelAt (int x, int y) const |
| Returns the red channel of the image at the given pixel. More...
|
|
| ManagedData () |
| Constructor.
|
|
virtual | ~ManagedData () |
| Virtual destructor. More...
|
|
int | incRef () |
| Increment references to the managed data. More...
|
|
int | decRef () |
| Decrement references to the managed data. More...
|
|
bool | isUnreferenced () const |
| Reports if the data is referenced. More...
|
|
|
static void | newGLContext () |
| The function to call when an OpenGL context has changed.
|
|
static void | start () |
| Initializes the image system. More...
|
|
static void | release () |
| Called when done using images.
|
|
|
int | _refCount |
| The number of data wrappers using this managed data.
|
|
Manged image data (see ManagedData).
int Menge::ImageData::getBpp |
( |
| ) |
const |
Reports the bits per pixel.
- Returns
- Either 24 or 32, depending on whether the image has an alpha channel (32) or not (24).
int Menge::ImageData::getHeight |
( |
| ) |
const |
|
inline |
Returns the height of the image (in pixels).
- Returns
- The height of the image (in pixels).
unsigned char Menge::ImageData::getPixelAt |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
Returns the red channel of the image at the given pixel.
- Parameters
-
x | The x-coordinate of the pixel. |
y | The y-coordinate of the pixel. |
- Returns
- the red channel of the image at the given pixel.
int Menge::ImageData::getWidth |
( |
| ) |
const |
|
inline |
Returns the width of the image (in pixels).
- Returns
- The width of the image (in pixels).
void Menge::ImageData::start |
( |
| ) |
|
|
static |
Initializes the image system.
Must be called before images can be used. Essentially, it calls the SDL Image initialization
ImageData* readImageData |
( |
const std::string & |
fileName | ) |
|
|
friend |
Loads the image from a file (specified by name)
- Parameters
-
fileName | The path to a valid image file. |
- Returns
- A pointer to the underlying ImageData. If there is an error, NULL is returned.
The documentation for this class was generated from the following files:
- src/menge/MengeCore/SceneGraph/image.h
- src/menge/MengeCore/SceneGraph/image.cpp