hoa_video::ImageDescriptor Class Reference

The abstract base class for StillImage and AnimatedImage. More...

#include <image.h>

Inheritance diagram for hoa_video::ImageDescriptor:

Inheritance graph
[legend]
Collaboration diagram for hoa_video::ImageDescriptor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void Clear ()=0
 Clears all data retained by the object (color, width, height, etc.).
void Draw ()
 Draws the image to the display buffer.
 ImageDescriptor ()
bool Load ()
 Loads the image file, and returns true if it was successful.
bool Save (const std::string filename) const
 Saves the image to a file.
virtual ~ImageDescriptor ()
Class Member Get Functions
virtual float GetHeight () const=0
 Returns image height.
virtual float GetWidth () const=0
 Returns the image width.
bool IsAnimated () const
 Returns true if the image is animated.
bool IsGrayScale () const
 Returns true if the image is grayscale.
Class Member Set Functions
virtual void SetColor (const Color &color)=0
 Sets the image's color.
virtual void SetDimensions (const float width, const float height)=0
 Sets the image's dimensions, expressed as coordinate system units.
virtual void SetHeight (const float height)=0
 Sets the image's height, expressed as coordinate system units.
virtual void SetStatic (const bool is_static)=0
 Makes the image static.
virtual void SetVertexColors (const Color &tl, const Color &tr, const Color &bl, const Color &br)=0
 Sets the image's vertex colors.
virtual void SetWidth (const float width)=0
 Sets the image's width, expressed as coordinate system units.

Protected Member Functions

void _Clear ()
 Clears the data elements of the descriptor.

Protected Attributes

bool _animated
 True if this image is animated.
Color _color [4]
 Holds the color of the upper left, upper right, lower left, and lower right vertices, respectively.
bool _grayscale
 True if this image is grayscale.
float _height
bool _is_static
 Indicates whether the image being loaded should be loaded into a non-volatile area of texture memory.
bool _loaded
 Flag indicating if the image is already loaded.
float _width
 The width and height of the image, in coordinate system units. If this represents a compound StillImage is a compound, (i.e. it contains multiple images) then the width and height refer to the entire compound.

Friends

class GameVideo

Detailed Description

The abstract base class for StillImage and AnimatedImage.

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

Definition at line 223 of file image.h.


Constructor & Destructor Documentation

hoa_video::ImageDescriptor::ImageDescriptor (  ) 

Definition at line 139 of file image.cpp.

References _color, and hoa_video::Color::white.

virtual hoa_video::ImageDescriptor::~ImageDescriptor (  )  [inline, virtual]

Definition at line 228 of file image.h.


Member Function Documentation

void hoa_video::ImageDescriptor::_Clear (  )  [protected]

Clears the data elements of the descriptor.

Definition at line 172 of file image.cpp.

References _color, _grayscale, _height, _is_static, _loaded, _width, and hoa_video::Color::white.

Referenced by hoa_video::AnimatedImage::Clear(), and hoa_video::StillImage::Clear().

virtual void hoa_video::ImageDescriptor::Clear (  )  [pure virtual]

Clears all data retained by the object (color, width, height, etc.).

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

void hoa_video::ImageDescriptor::Draw (  ) 

Draws the image to the display buffer.

Definition at line 157 of file image.cpp.

References hoa_video::GameVideo::DrawImage(), and hoa_video::VideoManager.

Referenced by hoa_map::private_map::DialogueManager::Draw(), and hoa_battle::private_battle::BattleCharacterActor::DrawSprite().

Here is the call graph for this function:

virtual float hoa_video::ImageDescriptor::GetHeight (  )  const [pure virtual]

Returns image height.

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

virtual float hoa_video::ImageDescriptor::GetWidth (  )  const [pure virtual]

Returns the image width.

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

bool hoa_video::ImageDescriptor::IsAnimated (  )  const [inline]

Returns true if the image is animated.

Note:
This can also be used to determine whether an ImageDescriptor pointer is a StillImage or an AnimatedImage. This would be a better solution than trying to do a dynamic_cast on the pointer.

Definition at line 288 of file image.h.

References _animated.

bool hoa_video::ImageDescriptor::IsGrayScale (  )  const [inline]

Returns true if the image is grayscale.

Definition at line 280 of file image.h.

References _grayscale.

bool hoa_video::ImageDescriptor::Load (  ) 

Loads the image file, and returns true if it was successful.

Definition at line 151 of file image.cpp.

References hoa_video::GameVideo::LoadImage(), and hoa_video::VideoManager.

Referenced by hoa_map::MapMode::_Load(), hoa_map::private_map::DialogueManager::DialogueManager(), hoa_global::GlobalArmor::GlobalArmor(), hoa_global::GlobalItem::GlobalItem(), hoa_global::GlobalWeapon::GlobalWeapon(), and hoa_video::GameVideo::SingletonInitialize().

Here is the call graph for this function:

bool hoa_video::ImageDescriptor::Save ( const std::string  filename  )  const

Saves the image to a file.

The image can be saved as PNG or JPG. Choosing will be done by checking the filename, that must include the extension (.jpg, .jpeg or .png)

Parameters:
filename Name of the file to be stored.

Definition at line 163 of file image.cpp.

References _animated, hoa_video::GameVideo::SaveImage(), and hoa_video::VideoManager.

Here is the call graph for this function:

virtual void hoa_video::ImageDescriptor::SetColor ( const Color color  )  [pure virtual]

Sets the image's color.

Parameters:
color The desired color of the image.

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

virtual void hoa_video::ImageDescriptor::SetDimensions ( const float  width,
const float  height 
) [pure virtual]

Sets the image's dimensions, expressed as coordinate system units.

Parameters:
width desired width of the image
height desired height of the image

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

virtual void hoa_video::ImageDescriptor::SetHeight ( const float  height  )  [pure virtual]

Sets the image's height, expressed as coordinate system units.

Parameters:
height The desired height of the image.

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

virtual void hoa_video::ImageDescriptor::SetStatic ( const bool  is_static  )  [pure virtual]

Makes the image static.

Parameters:
is_static Set to true to make the image static.

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

virtual void hoa_video::ImageDescriptor::SetVertexColors ( const Color tl,
const Color tr,
const Color bl,
const Color br 
) [pure virtual]

Sets the image's vertex colors.

Parameters:
tl The top left vertex color..
tr The top right vertex color.
bl The bottom left vertex color.
br The bottom right vertex color.

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

virtual void hoa_video::ImageDescriptor::SetWidth ( const float  width  )  [pure virtual]

Sets the image's width, expressed as coordinate system units.

Parameters:
width The desired width of the image.

Implemented in hoa_video::StillImage, and hoa_video::AnimatedImage.


Friends And Related Function Documentation

friend class GameVideo [friend]

Reimplemented in hoa_video::StillImage, and hoa_video::AnimatedImage.

Definition at line 224 of file image.h.


Member Data Documentation

bool hoa_video::ImageDescriptor::_animated [protected]

True if this image is animated.

Definition at line 323 of file image.h.

Referenced by hoa_video::AnimatedImage::AnimatedImage(), IsAnimated(), Save(), and hoa_video::StillImage::StillImage().

Color hoa_video::ImageDescriptor::_color[4] [protected]

Holds the color of the upper left, upper right, lower left, and lower right vertices, respectively.

Definition at line 314 of file image.h.

Referenced by _Clear(), hoa_video::AnimatedImage::AddFrame(), hoa_video::StillImage::GetVertexColor(), ImageDescriptor(), hoa_video::StillImage::SetColor(), hoa_video::AnimatedImage::SetColor(), hoa_video::StillImage::SetVertexColors(), and hoa_video::AnimatedImage::SetVertexColors().

bool hoa_video::ImageDescriptor::_grayscale [protected]

True if this image is grayscale.

Definition at line 320 of file image.h.

Referenced by _Clear(), hoa_video::AnimatedImage::AnimatedImage(), hoa_video::StillImage::DisableGrayScale(), hoa_video::StillImage::EnableGrayScale(), IsGrayScale(), and hoa_video::StillImage::StillImage().

float hoa_video::ImageDescriptor::_height [protected]

Definition at line 311 of file image.h.

Referenced by _Clear(), hoa_video::AnimatedImage::AddFrame(), hoa_video::StillImage::AddImage(), hoa_video::StillImage::GetHeight(), hoa_video::AnimatedImage::SetDimensions(), hoa_video::StillImage::SetDimensions(), hoa_video::AnimatedImage::SetHeight(), and hoa_video::StillImage::SetHeight().

bool hoa_video::ImageDescriptor::_is_static [protected]

Indicates whether the image being loaded should be loaded into a non-volatile area of texture memory.

Definition at line 317 of file image.h.

Referenced by _Clear(), hoa_video::AnimatedImage::AddFrame(), hoa_video::StillImage::EnableGrayScale(), hoa_video::AnimatedImage::SetStatic(), and hoa_video::StillImage::SetStatic().

bool hoa_video::ImageDescriptor::_loaded [protected]

Flag indicating if the image is already loaded.

Definition at line 326 of file image.h.

Referenced by _Clear().

float hoa_video::ImageDescriptor::_width [protected]

The width and height of the image, in coordinate system units. If this represents a compound StillImage is a compound, (i.e. it contains multiple images) then the width and height refer to the entire compound.

Definition at line 311 of file image.h.

Referenced by _Clear(), hoa_video::AnimatedImage::AddFrame(), hoa_video::StillImage::AddImage(), hoa_video::StillImage::GetWidth(), hoa_video::AnimatedImage::SetDimensions(), hoa_video::StillImage::SetDimensions(), hoa_video::AnimatedImage::SetWidth(), and hoa_video::StillImage::SetWidth().


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