|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Static Public Member Functions
gameplay::Image Class Reference

`#include <Image.h>`

Inheritance diagram for gameplay::Image:

List of all members.

## Public Types

enum | Format { RGB, RGBA }

## Public Member Functions

unsigned char * | getData () const
Format | getFormat () const
unsigned int | getHeight () const
unsigned int | getWidth () const

## Static Public Member Functions

static Image * | create (const char *path)
static Image * | create (unsigned int width, unsigned int height, Format format, unsigned char *data=NULL)

## Detailed Description

Defines an image buffer of RGB or RGBA color data.

Currently only supports loading from .png image files.

## Member Enumeration Documentation

enum gameplay::Image::Format

Defines the set of supported color formats.

## Member Function Documentation

static Image* gameplay::Image::create | ( | const char * | path | ) | `[static]`

Creates an image from the image file at the given path.

Parameters:

  path | The path to the image file.

Returns:
  The newly created image.

static Image* gameplay::Image::create | ( | unsigned int | width,
|  | unsigned int | height,
|  | Format | format,
|  | unsigned char * | data = `NULL`
| ) |  | `[static]`

Creates an image from the data provided

Parameters:

  width | The width of the image data.
  height | The height of the image data.
  format | The format of the image data.
  data | The image data. If NULL, the data will be allocated.

Returns:
  The newly created image.

unsigned char* gameplay::Image::getData | ( |  | ) | const`[inline]`

Gets the image's raw pixel data.

Returns:
  The image's pixel data.

Format gameplay::Image::getFormat | ( |  | ) | const`[inline]`

Gets the image's format.

Returns:
  The image's format.

unsigned int gameplay::Image::getHeight | ( |  | ) | const`[inline]`

Gets the height of the image.

Returns:
  The height of the image.

unsigned int gameplay::Image::getWidth | ( |  | ) | const`[inline]`

Gets the width of the image.

Returns:
  The width of the image.

All Classes Functions Variables Typedefs Enumerations Enumerator