hx3d  1
2D/3D Simple Game Framework
Public Member Functions | List of all members
hx3d::graphics::Image Class Reference

Real-time editable texture. More...

#include <image.hpp>

Public Member Functions

 Image ()
 Construct an empty image. Use create to create the image.
 
 Image (unsigned int width, unsigned int height)
 Construct an image with a width and height. More...
 
void create (unsigned int width, unsigned int height)
 Initialize an image. More...
 
void set (unsigned int x, unsigned int y, Color color)
 Set a pixel with a color. More...
 
void setRect (unsigned int x, unsigned int y, unsigned int w, unsigned int h, Color color)
 Set a rectangle with a color. More...
 
Color get (unsigned int x, unsigned int y)
 Get a pixel color. More...
 
Ptr< TexturegetTexture ()
 Get the texture. More...
 
unsigned int getWidth ()
 Get the image width. More...
 
unsigned int getHeight ()
 Get the image height. More...
 
void buildTexture ()
 Recreate a texture from the image.
 
void updateTextureZone (unsigned int x, unsigned int y, unsigned int w, unsigned int h)
 Update an existing texture zone. More...
 

Detailed Description

Real-time editable texture.

Definition at line 36 of file image.hpp.

Constructor & Destructor Documentation

hx3d::graphics::Image::Image ( unsigned int  width,
unsigned int  height 
)

Construct an image with a width and height.

Parameters
widthWidth
heightHeight

Definition at line 31 of file image.cpp.

Member Function Documentation

void hx3d::graphics::Image::create ( unsigned int  width,
unsigned int  height 
)

Initialize an image.

Parameters
widthWidth
heightHeight

Definition at line 37 of file image.cpp.

Color hx3d::graphics::Image::get ( unsigned int  x,
unsigned int  y 
)

Get a pixel color.

Parameters
xX coordinate
yY coordinate
Returns
Color

Definition at line 69 of file image.cpp.

unsigned int hx3d::graphics::Image::getHeight ( )

Get the image height.

Returns
Height

Definition at line 112 of file image.cpp.

Ptr< Texture > hx3d::graphics::Image::getTexture ( )

Get the texture.

Returns
Texture (Ptr)

Definition at line 74 of file image.cpp.

unsigned int hx3d::graphics::Image::getWidth ( )

Get the image width.

Returns
Width

Definition at line 108 of file image.cpp.

void hx3d::graphics::Image::set ( unsigned int  x,
unsigned int  y,
Color  color 
)

Set a pixel with a color.

Parameters
xX coordinate
yY coordinate
colorColor

Definition at line 44 of file image.cpp.

void hx3d::graphics::Image::setRect ( unsigned int  x,
unsigned int  y,
unsigned int  w,
unsigned int  h,
Color  color 
)

Set a rectangle with a color.

Parameters
xX coordinate
yY coordinate
wWidth
hHeight
colorColor

Definition at line 52 of file image.cpp.

void hx3d::graphics::Image::updateTextureZone ( unsigned int  x,
unsigned int  y,
unsigned int  w,
unsigned int  h 
)

Update an existing texture zone.

Parameters
xX coordinate
yY coordinate
wWidth
hHeight

Definition at line 85 of file image.cpp.


The documentation for this class was generated from the following files: