2D Graphics Canvas More...

#include <canvas.h>

Public Member Functions

virtual void begin ()=0
 Marks the start of a canvas rendering pass. More...
 
virtual void clear (const Colorf &color=Colorf::black)=0
 Clears the whole context using the specified color. More...
 
virtual Rectf clip () const =0
 Returns the current clipping rectangle. More...
 
virtual void end ()=0
 Marks the end of a canvas rendering pass. More...
 
virtual const GraphicContextPtrgc () const =0
 Returns the graphic context associated with this canvas. More...
 
virtual Pointf grid_fit (const Pointf &pos)=0
 Snaps the point to the nearest pixel corner. More...
 
virtual float height () const =0
 Returns the current height of the context. More...
 
virtual const Mat4finverse_transform () const =0
 Returns the inverse of the transform matrix. More...
 
void mult_transform (const Mat4f &matrix)
 Multiplies the passed matrix onto the transform matrix. More...
 
virtual float pixel_ratio () const =0
 
virtual void pop_clip ()=0
 Pop current clipping rectangle from the stack. More...
 
virtual const Mat4fprojection () const =0
 Returns the current effective projection matrix. More...
 
virtual void push_clip (const Rectf &rect)=0
 Push current clipping rectangle to stack. More...
 
virtual void push_clip ()=0
 
virtual void reset_clip ()=0
 Removes any active clipping rectangle and empties the clip stack. More...
 
virtual void set_clip (const Rectf &rect)=0
 Set the current clipping rectangle. More...
 
virtual void set_transform (const Mat4f &matrix)=0
 Sets the transform matrix to a new matrix. More...
 
virtual Sizef size () const =0
 Returns the current size of the context. More...
 
virtual const Mat4ftransform () const =0
 Returns the transform matrix. More...
 
virtual float width () const =0
 Returns the current width of the context. More...
 

Static Public Member Functions

static std::shared_ptr< Canvascreate (const DisplayWindowPtr &window)
 Constructs a canvas. More...
 

Detailed Description

2D Graphics Canvas

Member Function Documentation

virtual void uicore::Canvas::begin ( )
pure virtual

Marks the start of a canvas rendering pass.

Prepares the graphic context for rendering by binding the appropriate state.

virtual void uicore::Canvas::clear ( const Colorf color = Colorf::black)
pure virtual

Clears the whole context using the specified color.

virtual Rectf uicore::Canvas::clip ( ) const
pure virtual

Returns the current clipping rectangle.

static std::shared_ptr<Canvas> uicore::Canvas::create ( const DisplayWindowPtr window)
static

Constructs a canvas.

virtual void uicore::Canvas::end ( )
pure virtual

Marks the end of a canvas rendering pass.

All batched rendering requests are flushed and the graphic context state is reset to its defaults.

virtual const GraphicContextPtr& uicore::Canvas::gc ( ) const
pure virtual

Returns the graphic context associated with this canvas.

virtual Pointf uicore::Canvas::grid_fit ( const Pointf pos)
pure virtual

Snaps the point to the nearest pixel corner.

virtual float uicore::Canvas::height ( ) const
pure virtual

Returns the current height of the context.

virtual const Mat4f& uicore::Canvas::inverse_transform ( ) const
pure virtual

Returns the inverse of the transform matrix.

void uicore::Canvas::mult_transform ( const Mat4f matrix)
inline

Multiplies the passed matrix onto the transform matrix.

References set_transform(), and transform().

virtual float uicore::Canvas::pixel_ratio ( ) const
pure virtual

Retrieves the display pixel ratio of the context. Resolution Independence

virtual void uicore::Canvas::pop_clip ( )
pure virtual

Pop current clipping rectangle from the stack.

virtual const Mat4f& uicore::Canvas::projection ( ) const
pure virtual

Returns the current effective projection matrix.

virtual void uicore::Canvas::push_clip ( const Rectf rect)
pure virtual

Push current clipping rectangle to stack.

If a rectangle is passed, it afterwards sets clipping rectangle to the union of the current rectangle and the passed rectangle.

virtual void uicore::Canvas::push_clip ( )
pure virtual
virtual void uicore::Canvas::reset_clip ( )
pure virtual

Removes any active clipping rectangle and empties the clip stack.

virtual void uicore::Canvas::set_clip ( const Rectf rect)
pure virtual

Set the current clipping rectangle.

virtual void uicore::Canvas::set_transform ( const Mat4f matrix)
pure virtual

Sets the transform matrix to a new matrix.

Referenced by mult_transform().

virtual Sizef uicore::Canvas::size ( ) const
pure virtual

Returns the current size of the context.

virtual const Mat4f& uicore::Canvas::transform ( ) const
pure virtual

Returns the transform matrix.

Referenced by mult_transform().

virtual float uicore::Canvas::width ( ) const
pure virtual

Returns the current width of the context.


The documentation for this class was generated from the following file: