overview wiki api reference download
 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 Imagecreate (const char *path)
static Imagecreate (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

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.

pathThe path to the image file.
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

widthThe width of the image data.
heightThe height of the image data.
formatThe format of the image data.
dataThe image data. If NULL, the data will be allocated.
The newly created image.
unsigned char* gameplay::Image::getData ( ) const [inline]

Gets the image's raw pixel data.

The image's pixel data.
Format gameplay::Image::getFormat ( ) const [inline]

Gets the image's format.

The image's format.
unsigned int gameplay::Image::getHeight ( ) const [inline]

Gets the height of the image.

The height of the image.
unsigned int gameplay::Image::getWidth ( ) const [inline]

Gets the width of the image.

The width of the image.
 All Classes Functions Variables Typedefs Enumerations Enumerator