Pyro higlevel API
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
os::Image Class Referenceabstract

Container for image data. More...

Inheritance diagram for os::Image:
os::BitmapImage

Classes

class  Private
 

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. More...
 
virtual ~Image ()
 
virtual const String ImageType (void) const =0
 Run-time type checking. More...
 
virtual bool IsValid (void) const =0
 Check if object is initialized and ready to be used. More...
 
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. More...
 
virtual void Draw (const Rect &cSource, const Rect &cDest, View *pcView)=0
 Draw an image to a View. More...
 
virtual status_t SetSize (const Point &cSize)
 Set the size of the image. More...
 
virtual Point GetSize (void) const
 Get image size. More...
 
Rect GetBounds (void) const
 Get image bounds. More...
 
virtual status_t ApplyFilter (uint32 nFilterID)
 
virtual status_t ApplyFilter (const Message &cFilterData)
 

Public Attributes

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

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 (henri.nosp@m.k@bo.nosp@m.ing.n.nosp@m.u)

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 (henri.nosp@m.k@bo.nosp@m.ing.n.nosp@m.u)
Image::~Image ( )
virtual

Member Function Documentation

status_t Image::ApplyFilter ( uint32  nFilterID)
virtual
status_t Image::ApplyFilter ( const Message cFilterData)
virtual

Reimplemented 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
cPosPosition in the destination View to draw at.
pcViewThe View to draw in.
See Also
os::View
Author
Henrik Isaksson (henri.nosp@m.k@bo.nosp@m.ing.n.nosp@m.u)

Implemented in os::BitmapImage.

Referenced by os::MenuItem::Draw(), os::TreeViewCheckNode::Paint(), os::PopupMenu::Paint(), os::ImageButton::Paint(), os::ImageView::Paint(), os::TreeViewStringNode::Paint(), os::ImageView::Refresh(), and os::IconView::Private::RenderIcon().

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
cSourceRectangular region in the source Image to draw.
cDestRectangular 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.
pcViewThe View to draw in.
Todo:
Implement scaling. Needs support from os::View.
See Also
os::View
Author
Henrik Isaksson (henri.nosp@m.k@bo.nosp@m.ing.n.nosp@m.u)

Implemented 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 (henri.nosp@m.k@bo.nosp@m.ing.n.nosp@m.u)

References GetSize(), os::Point::x, and os::Point::y.

Referenced by os::MenuItem::Draw(), and os::ImageView::Paint().

Point Image::GetSize ( void  ) const
virtual
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.

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
cSizeThe new size.
See Also
GetSize()
Author
Henrik Isaksson (henri.nosp@m.k@bo.nosp@m.ing.n.nosp@m.u)

Reimplemented in os::BitmapImage.

References os::Image::Private::m_cSize.

Member Data Documentation

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