CL_Image Class Reference
[clanDisplay 2D]

Image class. More...

#include <image.h>

List of all members.

Public Member Functions

Construction
 CL_Image ()
 Constructs a null image.
 CL_Image (CL_GraphicContext &context, CL_Texture texture, CL_Rect rect)
 Constructs an image from a texture.
 CL_Image (CL_GraphicContext &context, CL_Subtexture &sub_texture)
 Constructs an image from a subtexture.
 CL_Image (CL_GraphicContext &gc, const CL_PixelBuffer &pixelbuffer)
 Constructs a Image from a pixelbuffer.
 CL_Image (CL_GraphicContext &context, const CL_StringRef &filename)
 Constructs a Image.
 CL_Image (CL_GraphicContext &context, const CL_StringRef &filename, CL_VirtualDirectory &dir)
 Constructs a Image.
 CL_Image (CL_GraphicContext &context, const CL_StringRef &resource_id, CL_ResourceManager *resources)
 Constructs a Image.
virtual ~CL_Image ()
Attributes
bool is_null () const
 Returns true if the image is not properly constructed.
float get_scale_x () const
 Returns x scale.
float get_scale_y () const
 Returns y scale.
float get_alpha () const
 Returns current alpha.
CL_Colorf get_color () const
 Returns current color.
void get_alignment (CL_Origin &origin, int &x, int &y) const
 Returns translation hot-spot.
CL_Size get_size () const
 Get Size.
int get_width () const
 Return the width of the image.
int get_height () const
 Return the height of the image.
Operators
bool operator== (const CL_Image &other) const
 Equality operator.
bool operator!= (const CL_Image &other) const
 Inequality operator.
bool operator< (const CL_Image &other) const
 Less than operator.
Operations
void draw (CL_GraphicContext &gc, float x, float y) const
 Draw image on graphic context.
void draw (CL_GraphicContext &gc, int x, int y) const
void draw (CL_GraphicContext &gc, const CL_Rectf &src, const CL_Rectf &dest) const
void draw (CL_GraphicContext &gc, const CL_Rectf &dest) const
void set_scale (float x, float y)
 Set scale for x and y directions individually.
void set_alpha (float alpha)
 Sets transparency.
void set_color (const CL_Colorf &color)
 Sets the color.
void set_color (const CL_Color &c)
 Set color.
void set_alignment (CL_Origin origin, int x=0, int y=0)
 Sets translation hotspot.


Detailed Description

Image class.


Constructor & Destructor Documentation

CL_Image::CL_Image  ) 
 

Constructs a null image.

CL_Image::CL_Image CL_GraphicContext context,
CL_Texture  texture,
CL_Rect  rect
 

Constructs an image from a texture.

Parameters:
context = Graphic Context
texture = Texture to get image data from
rect = Position and size in texture to get image data from

CL_Image::CL_Image CL_GraphicContext context,
CL_Subtexture sub_texture
 

Constructs an image from a subtexture.

Parameters:
context = Graphic Context
sub_texture = Subtexture to get image data from

CL_Image::CL_Image CL_GraphicContext gc,
const CL_PixelBuffer pixelbuffer
 

Constructs a Image from a pixelbuffer.

Parameters:
context = Graphic Context
pixelbuffer = Pixelbuffer to get image data from

CL_Image::CL_Image CL_GraphicContext context,
const CL_StringRef filename
 

Constructs a Image.

Parameters:
context = Graphic Context
filename Filename of image to load

CL_Image::CL_Image CL_GraphicContext context,
const CL_StringRef filename,
CL_VirtualDirectory dir
 

Constructs a Image.

Parameters:
context = Graphic Context
filename Filename of image to load
dir = Virtual directory to load filename from

CL_Image::CL_Image CL_GraphicContext context,
const CL_StringRef resource_id,
CL_ResourceManager resources
 

Constructs a Image.

Parameters:
context = Graphic Context
resource_id Resource name of the image resource
resources Resource manager used to load resource

virtual CL_Image::~CL_Image  )  [virtual]
 


Member Function Documentation

void CL_Image::draw CL_GraphicContext gc,
const CL_Rectf dest
const
 

void CL_Image::draw CL_GraphicContext gc,
const CL_Rectf src,
const CL_Rectf dest
const
 

void CL_Image::draw CL_GraphicContext gc,
int  x,
int  y
const
 

void CL_Image::draw CL_GraphicContext gc,
float  x,
float  y
const
 

Draw image on graphic context.

Parameters:
x,y Anchor position of where to render image. Actual rendering position depends on the anchor and the alignment mode.
gc Graphic context on which to render upon.
src Source rectangle to draw. Use this is draw only part of the image.
dest Rectangle to draw image in.

void CL_Image::get_alignment CL_Origin origin,
int &  x,
int &  y
const
 

Returns translation hot-spot.

float CL_Image::get_alpha  )  const
 

Returns current alpha.

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

CL_Colorf CL_Image::get_color  )  const
 

Returns current color.

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

int CL_Image::get_height  )  const
 

Return the height of the image.

float CL_Image::get_scale_x  )  const
 

Returns x scale.

1.0f is normal scale, 2.0f is twice the size, etc.

float CL_Image::get_scale_y  )  const
 

Returns y scale.

1.0f is normal scale, 2.0f is twice the size, etc.

CL_Size CL_Image::get_size  )  const
 

Get Size.

Returns:
size

int CL_Image::get_width  )  const
 

Return the width of the image.

bool CL_Image::is_null  )  const
 

Returns true if the image is not properly constructed.

bool CL_Image::operator!= const CL_Image other  )  const [inline]
 

Inequality operator.

bool CL_Image::operator< const CL_Image other  )  const [inline]
 

Less than operator.

bool CL_Image::operator== const CL_Image other  )  const [inline]
 

Equality operator.

void CL_Image::set_alignment CL_Origin  origin,
int  x = 0,
int  y = 0
 

Sets translation hotspot.

void CL_Image::set_alpha float  alpha  ) 
 

Sets transparency.

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

void CL_Image::set_color const CL_Color c  )  [inline]
 

Set color.

Parameters:
c = Color

void CL_Image::set_color const CL_Colorf color  ) 
 

Sets the color.

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

void CL_Image::set_scale float  x,
float  y
 

Set scale for x and y directions individually.

1.0f is normal scale, 2.0f is twice the size, etc.


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 02:39:38 2009 for ClanLib by  doxygen 1.4.6