Crazy Eddies GUI System  0.7.2
Public Member Functions | Friends | List of all members
CEGUI::Image Class Reference

Class that represents a single Image of an Imageset. More...

Public Member Functions

Size getSize (void) const
 Return a Size object containing the dimensions of the Image. More...
 
float getWidth (void) const
 Return the pixel width of the image. More...
 
float getHeight (void) const
 Return the pixel height of the image. More...
 
Point getOffsets (void) const
 Return a Point object that contains the offset applied when rendering this Image. More...
 
float getOffsetX (void) const
 Return the X rendering offset. More...
 
float getOffsetY (void) const
 Return the Y rendering offset. More...
 
const StringgetName (void) const
 Return the name of this Image object. More...
 
const StringgetImagesetName (void) const
 Return the name of the Imageset that contains this Image. More...
 
const ImagesetgetImageset (void) const
 Return the parent Imageset object that contains this Image. More...
 
const RectgetSourceTextureArea (void) const
 Return Rect describing the source texture area used by this Image. More...
 
void draw (GeometryBuffer &buffer, const Vector2 &position, const Size &size, const Rect *clip_rect, const colour &top_left_colour=0xFFFFFFFF, const colour &top_right_colour=0xFFFFFFFF, const colour &bottom_left_colour=0xFFFFFFFF, const colour &bottom_right_colour=0xFFFFFFFF, QuadSplitMode quad_split_mode=TopLeftToBottomRight) const
 Queue the image to be drawn. More...
 
void draw (GeometryBuffer &buffer, const Rect &dest_rect, const Rect *clip_rect, const colour &top_left_colour=0xFFFFFFFF, const colour &top_right_colour=0xFFFFFFFF, const colour &bottom_left_colour=0xFFFFFFFF, const colour &bottom_right_colour=0xFFFFFFFF, QuadSplitMode quad_split_mode=TopLeftToBottomRight) const
 Queue the image to be drawn. More...
 
void draw (GeometryBuffer &buffer, const Vector2 &position, const Size &size, const Rect *clip_rect, const ColourRect &colours, QuadSplitMode quad_split_mode=TopLeftToBottomRight) const
 Queue the image to be drawn. More...
 
void draw (GeometryBuffer &buffer, const Vector2 &position, const Rect *clip_rect, const ColourRect &colours, QuadSplitMode quad_split_mode=TopLeftToBottomRight) const
 Queue the image to be drawn. More...
 
void draw (GeometryBuffer &buffer, const Vector2 &position, const Rect *clip_rect, const colour &top_left_colour=0xFFFFFFFF, const colour &top_right_colour=0xFFFFFFFF, const colour &bottom_left_colour=0xFFFFFFFF, const colour &bottom_right_colour=0xFFFFFFFF, QuadSplitMode quad_split_mode=TopLeftToBottomRight) const
 Queue the image to be drawn. More...
 
void draw (GeometryBuffer &buffer, const Rect &dest_rect, const Rect *clip_rect, const ColourRect &colours, QuadSplitMode quad_split_mode=TopLeftToBottomRight) const
 Queue the image to be drawn. More...
 
void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of this Image object to out_stream. More...
 
 Image (void)
 Default constructor (only used by std::map)
 
 Image (const Imageset *owner, const String &name, const Rect &area, const Point &render_offset, float horzScaling=1.0f, float vertScaling=1.0f)
 Constructor for Image objects. This is not normally used directly by client code, use the Imageset interface instead. More...
 
 Image (const Image &image)
 Copy constructor.
 
 ~Image (void)
 Destructor for Image objects.
 

Friends

class std::map< String, Image, String::FastLessCompare >
 
struct std::pair< const String, Image >
 
class Imageset
 

Detailed Description

Class that represents a single Image of an Imageset.

Constructor & Destructor Documentation

CEGUI::Image::Image ( const Imageset owner,
const String name,
const Rect area,
const Point render_offset,
float  horzScaling = 1.0f,
float  vertScaling = 1.0f 
)

Constructor for Image objects. This is not normally used directly by client code, use the Imageset interface instead.

Parameters
ownerPointer to a Imageset object that owns this Image. This must not be NULL.
nameString object describing the name of the image being created.
areaRect object describing an area that will be associated with this image.
render_offsetPoint object that describes the offset to be applied when rendering this image.
horzScalingfloat value indicating the initial horizontal scaling to be applied to this image.
vertScalingfloat value indicating the initial vertical scaling to be applied to this image.
Exceptions
NullObjectExceptionThrown if owner was NULL.

Member Function Documentation

void CEGUI::Image::draw ( GeometryBuffer buffer,
const Vector2 position,
const Size size,
const Rect clip_rect,
const colour top_left_colour = 0xFFFFFFFF,
const colour top_right_colour = 0xFFFFFFFF,
const colour bottom_left_colour = 0xFFFFFFFF,
const colour bottom_right_colour = 0xFFFFFFFF,
QuadSplitMode  quad_split_mode = TopLeftToBottomRight 
) const
inline

Queue the image to be drawn.

Note
The final position of the Image will be adjusted by the offset values defined for this Image object. If absolute positioning is essential then these values should be taken into account prior to calling the draw() methods. However, by doing this you take away the ability of the Imageset designer to adjust the alignment and positioning of Images, therefore your component is far less useful since it requires code changes to modify image positioning that could have been handled from a data file.
Parameters
bufferGeometryBuffer object where the geometry for the image will be queued.
positionVector2 object containing the location where the Image is to be drawn
sizeSize object describing the size that the Image is to be drawn at.
clip_rectRect object that defines an on-screen area that the Image will be clipped to when drawing.
top_left_colourColour to be applied to the top-left corner of the Image.
top_right_colourColour to be applied to the top-right corner of the Image.
bottom_left_colourColour to be applied to the bottom-left corner of the Image.
bottom_right_colourColour to be applied to the bottom-right corner of the Image.
quad_split_modeOne of the QuadSplitMode values specifying the way the quad geometry for the image is to be split into triangles.
Returns
Nothing
void CEGUI::Image::draw ( GeometryBuffer buffer,
const Rect dest_rect,
const Rect clip_rect,
const colour top_left_colour = 0xFFFFFFFF,
const colour top_right_colour = 0xFFFFFFFF,
const colour bottom_left_colour = 0xFFFFFFFF,
const colour bottom_right_colour = 0xFFFFFFFF,
QuadSplitMode  quad_split_mode = TopLeftToBottomRight 
) const
inline

Queue the image to be drawn.

Note
The final position of the Image will be adjusted by the offset values defined for this Image object. If absolute positioning is essential then these values should be taken into account prior to calling the draw() methods. However, by doing this you take away the ability of the Imageset designer to adjust the alignment and positioning of Images, therefore your component is far less useful since it requires code changes to modify image positioning that could have been handled from a data file.
Parameters
bufferGeometryBuffer object where the geometry for the image will be queued.
dest_rectRect object defining the area on-screen where the Image is to be drawn. The Image will be scaled to fill the area as required.
clip_rectRect object that defines an on-screen area that the Image will be clipped to when drawing.
top_left_colourColour to be applied to the top-left corner of the Image.
top_right_colourColour to be applied to the top-right corner of the Image.
bottom_left_colourColour to be applied to the bottom-left corner of the Image.
bottom_right_colourColour to be applied to the bottom-right corner of the Image.
quad_split_modeOne of the QuadSplitMode values specifying the way the quad geometry for the image is to be split into triangles.
Returns
Nothing
void CEGUI::Image::draw ( GeometryBuffer buffer,
const Vector2 position,
const Size size,
const Rect clip_rect,
const ColourRect colours,
QuadSplitMode  quad_split_mode = TopLeftToBottomRight 
) const
inline

Queue the image to be drawn.

Note
The final position of the Image will be adjusted by the offset values defined for this Image object. If absolute positioning is essential then these values should be taken into account prior to calling the draw() methods. However, by doing this you take away the ability of the Imageset designer to adjust the alignment and positioning of Images, therefore your component is far less useful since it requires code changes to modify image positioning that could have been handled from a data file.
Parameters
bufferGeometryBuffer object where the geometry for the image will be queued.
positionVector2 object containing the location where the Image is to be drawn.
sizeSize object describing the size that the Image is to be drawn at.
clip_rectRect object that defines an on-screen area that the Image will be clipped to when drawing.
coloursColourRect object that describes the colour values to use for each corner of the Image.
quad_split_modeOne of the QuadSplitMode values specifying the way the quad geometry for the image is to be split into triangles.
Returns
Nothing
void CEGUI::Image::draw ( GeometryBuffer buffer,
const Vector2 position,
const Rect clip_rect,
const ColourRect colours,
QuadSplitMode  quad_split_mode = TopLeftToBottomRight 
) const
inline

Queue the image to be drawn.

Note
The final position of the Image will be adjusted by the offset values defined for this Image object. If absolute positioning is essential then these values should be taken into account prior to calling the draw() methods. However, by doing this you take away the ability of the Imageset designer to adjust the alignment and positioning of Images, therefore your component is far less useful since it requires code changes to modify image positioning that could have been handled from a data file.
Parameters
bufferGeometryBuffer object where the geometry for the image will be queued.
positionVector2 object containing the location where the Image is to be drawn
Note
The image will be drawn at it's internally defined size.
Parameters
clip_rectRect object that defines an on-screen area that the Image will be clipped to when drawing.
coloursColourRect object that describes the colour values to use for each corner of the Image.
quad_split_modeOne of the QuadSplitMode values specifying the way the quad geometry for the image is to be split into triangles.
Returns
Nothing
void CEGUI::Image::draw ( GeometryBuffer buffer,
const Vector2 position,
const Rect clip_rect,
const colour top_left_colour = 0xFFFFFFFF,
const colour top_right_colour = 0xFFFFFFFF,
const colour bottom_left_colour = 0xFFFFFFFF,
const colour bottom_right_colour = 0xFFFFFFFF,
QuadSplitMode  quad_split_mode = TopLeftToBottomRight 
) const
inline

Queue the image to be drawn.

Note
The final position of the Image will be adjusted by the offset values defined for this Image object. If absolute positioning is essential then these values should be taken into account prior to calling the draw() methods. However, by doing this you take away the ability of the Imageset designer to adjust the alignment and positioning of Images, therefore your component is far less useful since it requires code changes to modify image positioning that could have been handled from a data file.
Parameters
bufferGeometryBuffer object where the geometry for the image will be queued.
positionVector2 object containing the location where the Image is to be drawn
clip_rectRect object that defines an on-screen area that the Image will be clipped to when drawing.
top_left_colourColour to be applied to the top-left corner of the Image.
top_right_colourColour to be applied to the top-right corner of the Image.
bottom_left_colourColour to be applied to the bottom-left corner of the Image.
bottom_right_colourColour to be applied to the bottom-right corner of the Image.
quad_split_modeOne of the QuadSplitMode values specifying the way the quad geometry for the image is to be split into triangles.
Returns
Nothing
void CEGUI::Image::draw ( GeometryBuffer buffer,
const Rect dest_rect,
const Rect clip_rect,
const ColourRect colours,
QuadSplitMode  quad_split_mode = TopLeftToBottomRight 
) const

Queue the image to be drawn.

Note
The final position of the Image will be adjusted by the offset values defined for this Image object. If absolute positioning is essential then these values should be taken into account prior to calling the draw() methods. However, by doing this you take away the ability of the Imageset designer to adjust the alignment and positioning of Images, therefore your component is far less useful since it requires code changes to modify image positioning that could have been handled from a data file.
Parameters
bufferGeometryBuffer object where the geometry for the image will be queued.
dest_rectRect object defining the area on-screen where the Image is to be drawn. The Image will be scaled to fill the area as required.
clip_rectRect object that defines an on-screen area that the Image will be clipped to when drawing.
coloursColourRect object that describes the colour values to use for each corner of the Image.
quad_split_modeOne of the QuadSplitMode values specifying the way the quad geometry for the image is to be split into triangles.
Returns
Nothing
float CEGUI::Image::getHeight ( void  ) const
inline

Return the pixel height of the image.

Returns
Height of this Image in pixels
const Imageset* CEGUI::Image::getImageset ( void  ) const
inline

Return the parent Imageset object that contains this Image.

Returns
The parent Imageset object.
const String& CEGUI::Image::getImagesetName ( void  ) const

Return the name of the Imageset that contains this Image.

Returns
String object containing the name of the Imageset which this Image is a part of.
const String& CEGUI::Image::getName ( void  ) const

Return the name of this Image object.

Returns
String object containing the name of this Image
Point CEGUI::Image::getOffsets ( void  ) const
inline

Return a Point object that contains the offset applied when rendering this Image.

Returns
Point object containing the offsets applied when rendering this Image
float CEGUI::Image::getOffsetX ( void  ) const
inline

Return the X rendering offset.

Returns
X rendering offset. This is the number of pixels that the image is offset by when rendering at any given location.
float CEGUI::Image::getOffsetY ( void  ) const
inline

Return the Y rendering offset.

Returns
Y rendering offset. This is the number of pixels that the image is offset by when rendering at any given location.
Size CEGUI::Image::getSize ( void  ) const
inline

Return a Size object containing the dimensions of the Image.

Returns
Size object holding the width and height of the Image.
const Rect& CEGUI::Image::getSourceTextureArea ( void  ) const

Return Rect describing the source texture area used by this Image.

Returns
Rect object that describes, in pixels, the area upon the source texture which is used when rendering this Image.
float CEGUI::Image::getWidth ( void  ) const
inline

Return the pixel width of the image.

Returns
Width of this Image in pixels.
void CEGUI::Image::writeXMLToStream ( XMLSerializer xml_stream) const

Writes an xml representation of this Image object to out_stream.

Parameters
xml_streamStream where xml data should be output.
Returns
Nothing.