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:
gameplay::Ref

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.

Parameters:
pathThe 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:
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.
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