hoa_video::private_video::Image Class Reference

Represents a single image that is loaded and stored in a texture sheet. All the existing images will be stored in a map at the video engine. That way they can be shared among objects. More...

#include <image.h>

Collaboration diagram for hoa_video::private_video::Image:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Image (TexSheet *sheet, const std::string &fname, const std::string &tags_, int32 x_, int32 y_, float u1_, float v1_, float u2_, float v2_, int32 wifth, int32 height, bool grayscale_)
 Constructor where image coordinates are specified, along with texture coords and the texture sheet.
 Image (const std::string &fname, const std::string &tags_, int32 width, int32 height, bool grayscale_)
 Constructor defaults image as the first one in a texture sheet.
Imageoperator= (Image &rhs)

Public Attributes

std::string filename
 The filename for the image. This is stored for every image in case it needs to be reloaded. This may happen when a context change happens, such a switch from/to fullscreen mode or a resolution change.
bool grayscale
 Determines whether this image is in grayscale mode or not.
int32 height
int32 ref_count
 The number of times that this image is refereced by ImageDescriptors This is used to determine when the image may be deleted.
std::string tags
 String holding the tags defining the properties of the image.
TexSheettexture_sheet
 A pointer to the texture sheet where the image is contained.
float u1
 The actual uv coordinates. This is a little redundant, but saves effort on floating point calcuations. u1 and v1 are the upper-left UV coordinates, while u2 and v2 correspond to the lower-right. They are expressed in the [0.0,1.0] range.
float u2
float v1
float v2
int32 width
 The image's width and height, in coordinate system units.
int32 x
 The coordiates of where the image is located in the texture sheet (in pixels).
int32 y

Detailed Description

Represents a single image that is loaded and stored in a texture sheet. All the existing images will be stored in a map at the video engine. That way they can be shared among objects.

****************************************************************************

Definition at line 93 of file image.h.


Constructor & Destructor Documentation

hoa_video::private_video::Image::Image ( const std::string &  fname,
const std::string &  tags_,
int32  width,
int32  height,
bool  grayscale_ 
)

Constructor defaults image as the first one in a texture sheet.

Note:
The actual sheet where the image is located will be determined later.

Definition at line 30 of file image.cpp.

References ref_count, texture_sheet, u1, u2, v1, v2, x, and y.

hoa_video::private_video::Image::Image ( TexSheet sheet,
const std::string &  fname,
const std::string &  tags_,
int32  x_,
int32  y_,
float  u1_,
float  v1_,
float  u2_,
float  v2_,
int32  wifth,
int32  height,
bool  grayscale_ 
)

Constructor where image coordinates are specified, along with texture coords and the texture sheet.

Definition at line 49 of file image.cpp.

References ref_count.


Member Function Documentation

Image& hoa_video::private_video::Image::operator= ( Image rhs  )  [inline]

Definition at line 148 of file image.h.


Member Data Documentation

std::string hoa_video::private_video::Image::filename

The filename for the image. This is stored for every image in case it needs to be reloaded. This may happen when a context change happens, such a switch from/to fullscreen mode or a resolution change.

Definition at line 103 of file image.h.

Referenced by hoa_video::GameVideo::_DeleteImage(), hoa_video::GameVideo::_ReloadImagesToSheet(), hoa_video::GameVideo::_SaveTempTextures(), and hoa_video::StillImage::EnableGrayScale().

bool hoa_video::private_video::Image::grayscale

Determines whether this image is in grayscale mode or not.

Definition at line 132 of file image.h.

Referenced by hoa_video::GameVideo::_DeleteImage().

int32 hoa_video::private_video::Image::height

Definition at line 129 of file image.h.

Referenced by hoa_video::GameVideo::_DeleteImage(), hoa_video::GameVideo::_GetBufferFromImage(), hoa_video::GameVideo::_ReloadImagesToSheet(), and hoa_video::private_video::ParticleSystem::Draw().

int32 hoa_video::private_video::Image::ref_count

The number of times that this image is refereced by ImageDescriptors This is used to determine when the image may be deleted.

Definition at line 137 of file image.h.

Referenced by hoa_video::GameVideo::_DeleteImage(), hoa_video::GameVideo::_LoadImageHelper(), hoa_video::GameVideo::_LoadMultiImage(), hoa_video::GameVideo::CaptureScreen(), hoa_video::StillImage::EnableGrayScale(), and Image().

std::string hoa_video::private_video::Image::tags

String holding the tags defining the properties of the image.

The tags need to be present always in the same order, since they will be used as a key in the video engine's map. When adding new flags, remember to add the documentation in here. These are the currently supported flags, presented in the appearance order: <T> For temporary images <Xrow_ROWS> For multiimages <Ycol_COLS> For multiimages <G> Grayscale images Note that <T> and the multiimages tags can't appear together.

Definition at line 116 of file image.h.

Referenced by hoa_video::GameVideo::_ReloadImagesToSheet(), hoa_video::GameVideo::_SaveTempTextures(), and hoa_video::StillImage::EnableGrayScale().

TexSheet* hoa_video::private_video::Image::texture_sheet

A pointer to the texture sheet where the image is contained.

Definition at line 96 of file image.h.

Referenced by hoa_video::GameVideo::_DeleteImage(), hoa_video::GameVideo::_DrawElement(), hoa_video::GameVideo::_GetBufferFromImage(), hoa_video::GameVideo::_LoadMultiImage(), hoa_video::GameVideo::_ReloadImagesToSheet(), hoa_video::private_video::ParticleSystem::Draw(), Image(), and hoa_video::GameVideo::SaveImage().

float hoa_video::private_video::Image::u1

The actual uv coordinates. This is a little redundant, but saves effort on floating point calcuations. u1 and v1 are the upper-left UV coordinates, while u2 and v2 correspond to the lower-right. They are expressed in the [0.0,1.0] range.

Definition at line 126 of file image.h.

Referenced by hoa_video::GameVideo::_DrawElement(), hoa_video::private_video::ParticleSystem::Draw(), and Image().

float hoa_video::private_video::Image::u2

Definition at line 126 of file image.h.

Referenced by hoa_video::GameVideo::_DrawElement(), hoa_video::private_video::ParticleSystem::Draw(), and Image().

float hoa_video::private_video::Image::v1

Definition at line 126 of file image.h.

Referenced by hoa_video::GameVideo::_DrawElement(), hoa_video::private_video::ParticleSystem::Draw(), and Image().

float hoa_video::private_video::Image::v2

Definition at line 126 of file image.h.

Referenced by hoa_video::GameVideo::_DrawElement(), hoa_video::private_video::ParticleSystem::Draw(), and Image().

int32 hoa_video::private_video::Image::width

The image's width and height, in coordinate system units.

Definition at line 129 of file image.h.

Referenced by hoa_video::GameVideo::_DeleteImage(), hoa_video::GameVideo::_GetBufferFromImage(), hoa_video::GameVideo::_ReloadImagesToSheet(), and hoa_video::private_video::ParticleSystem::Draw().

int32 hoa_video::private_video::Image::x

The coordiates of where the image is located in the texture sheet (in pixels).

Definition at line 119 of file image.h.

Referenced by hoa_video::GameVideo::_GetBufferFromImage(), hoa_video::GameVideo::_ReloadImagesToSheet(), Image(), and hoa_video::GameVideo::SaveImage().

int32 hoa_video::private_video::Image::y

Definition at line 119 of file image.h.

Referenced by hoa_video::GameVideo::_GetBufferFromImage(), hoa_video::GameVideo::_ReloadImagesToSheet(), Image(), and hoa_video::GameVideo::SaveImage().


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:16:47 2007 for Hero of Allacrost by  doxygen 1.5.1