os::Image Class Reference
[The Syllable Graphical User Interface API]

Container for image data. More...

Inheritance diagram for os::Image:

os::BitmapImage List of all members.

Public Types

enum  {
  F_NONE,
  F_GRAY,
  F_HIGHLIGHT,
  F_ALPHA_TO_OVERLAY,
  F_GLOW,
  F_COLORIZE
}
 Filter types. More...

Public Member Functions

 Image ()
 Default constructor.
virtual ~Image ()
virtual const String ImageType (void) const=0
 Run-time type checking.
virtual bool IsValid (void) const=0
 Check if object is initialized and ready to be used.
virtual status_t Load (StreamableIO *pcSource, const String &cType="")=0
virtual status_t Save (StreamableIO *pcDest, const String &cType)=0
virtual void Draw (const Point &cPos, View *pcView)=0
 Draw an image to a View.
virtual void Draw (const Rect &cSource, const Rect &cDest, View *pcView)=0
 Draw an image to a View.
virtual status_t SetSize (const Point &cSize)
 Set the size of the image.
virtual Point GetSize (void) const
 Get image size.
Rect GetBounds (void) const
 Get image bounds.
virtual status_t ApplyFilter (uint32 nFilterID)
virtual status_t ApplyFilter (const Message &cFilterData)

Public Attributes

enum os::Image:: { ... }  FilterType
 Filter types.

Classes

class  Private

Detailed Description

Description:
The Image class defines the interface to image classes, ie. classes that contain image data, be it in the form of bitmaps or vectors.
See also:
os::BitmapImage, os::VectorImage, os::Bitmap, os::ImageView
Author:
Henrik Isaksson ([email protected])


Member Enumeration Documentation

anonymous enum

Description:
These values are used to specify to ApplyFilter() which filter to apply.
See also:
ApplyFilter()
Enumerator:
F_NONE  Does nothing.
F_GRAY  Creates a greyed out ("disabled") image.
F_HIGHLIGHT  Creates a highlighted ("selected") image.
F_ALPHA_TO_OVERLAY  Converts alpha channel data to colour overlay.
F_GLOW  Adds a "glowing" outline to the image.

See also:
GlowFilter
F_COLORIZE  Blend all pixels with a certain colour.

See also:
ColorizeFilter


Constructor & Destructor Documentation

Image::Image (  ) 

Author:
Henrik Isaksson ([email protected])

Image::~Image (  )  [virtual]


Member Function Documentation

virtual const String os::Image::ImageType ( void   )  const [pure virtual]

Implemented in os::BitmapImage.

virtual bool os::Image::IsValid ( void   )  const [pure virtual]

Implemented in os::BitmapImage.

virtual status_t os::Image::Load ( StreamableIO pcSource,
const String cType = "" 
) [pure virtual]

Implemented in os::BitmapImage.

virtual status_t os::Image::Save ( StreamableIO pcDest,
const String cType 
) [pure virtual]

Implemented in os::BitmapImage.

virtual void os::Image::Draw ( const Point cPos,
View pcView 
) [pure virtual]

Description:
This method renders the image to a View object.
Parameters:
cPos Position in the destination View to draw at.
pcView The View to draw in.
See also:
os::View
Author:
Henrik Isaksson ([email protected])

Implemented in os::BitmapImage.

virtual void os::Image::Draw ( const Rect cSource,
const Rect cDest,
View pcView 
) [pure virtual]

Description:
This method renders the image to a View object.
Parameters:
cSource Rectangular region in the source Image to draw.
cDest Rectangular region in the destination View to draw the image in. If the size of cDest is not equal to cSource, the image data from cSource will be scaled to fit.
pcView The View to draw in.
Todo:
Implement scaling. Needs support from os::View.
See also:
os::View
Author:
Henrik Isaksson ([email protected])

Implemented in os::BitmapImage.

status_t Image::SetSize ( const Point cSize  )  [virtual]

Description:
Scales the image. SetSize may provide better quality scaling than Draw(), which is optimized for speed rather than quality. You are not guaranteed to get exactly the requested size with kinds of image objects.
Parameters:
cSize The new size.
See also:
GetSize()
Author:
Henrik Isaksson ([email protected])

Reimplemented in os::BitmapImage.

Point Image::GetSize ( void   )  const [virtual]

Description:
Returns the size of the image. Note! This returns the actual size in pixels.
See also:
SetSize(), GetBounds()
Author:
Henrik Isaksson ([email protected])

Reimplemented in os::BitmapImage.

Rect Image::GetBounds ( void   )  const

Description:
Returns the size of the image as a Rect object (for consistency). Left and Top will typically be set to 0 and right/bottom to the value returned by GetSize() - 1. Note! GetBounds().Width() and GetBounds().Height() will return one less then GetSize().x and GetSize.y, due to coordinate system conventions.
See also:
SetSize(), GetBounds()
Author:
Henrik Isaksson ([email protected])

status_t Image::ApplyFilter ( uint32  nFilterID  )  [virtual]

status_t Image::ApplyFilter ( const Message cFilterData  )  [virtual]

Reimplemented in os::BitmapImage.


Member Data Documentation

enum { ... } os::Image::FilterType

Description:
These values are used to specify to ApplyFilter() which filter to apply.
See also:
ApplyFilter()


Generated on Sat May 9 22:51:30 2009 for Syllable higlevel API by  doxygen 1.5.1