SPH
Public Member Functions | List of all members
IRenderContext Class Referenceabstract

Abstraction of a device used for rendering. More...

#include <RenderContext.h>

Inheritance diagram for IRenderContext:
Polymorphic PreviewRenderContext< OverPixelOp > FlippedRenderContext PreviewRenderContext< PixelOp > WxRenderContext AntiAliasedRenderContext SmoothedRenderContext

Public Member Functions

virtual Pixel size () const =0
 Returns the size of the canvas associated with the context. More...
 
virtual void setColor (const Rgba &color, const Flags< ColorFlag > flags)=0
 Selects the color for one or more drawing modes. More...
 
virtual void setThickness (const float thickness)=0
 Modifies the thickness of the lines. More...
 
virtual void setFontSize (const int fontSize)=0
 
virtual void fill (const Rgba &color)=0
 Fills the whole canvas with given color. More...
 
virtual void drawLine (const Coords p1, const Coords p2)=0
 Draws a line connecting two points. More...
 
virtual void drawCircle (const Coords center, const float radius)=0
 Draws a circle, given its center and a radius. More...
 
virtual void drawTriangle (const Coords p1, const Coords p2, const Coords p3)=0
 Draws a triangle given three points. More...
 
virtual void drawBitmap (const Coords p, const Bitmap< Rgba > &bitmap)=0
 Draws a bitmap, given the position of its left-top corner. More...
 
virtual void drawText (const Coords p, const Flags< TextAlign > align, const std::string &s)=0
 
virtual void drawText (const Coords p, const Flags< TextAlign > align, const std::wstring &s)=0
 
virtual Array< IRenderOutput::LabelgetLabels () const
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Abstraction of a device used for rendering.

The interface is currently quite minimalistic, can be extended if needed.

Definition at line 22 of file RenderContext.h.

Member Function Documentation

◆ drawBitmap()

virtual void IRenderContext::drawBitmap ( const Coords  p,
const Bitmap< Rgba > &  bitmap 
)
pure virtual

Draws a bitmap, given the position of its left-top corner.

Implemented in FlippedRenderContext, WxRenderContext, PreviewRenderContext< PixelOp >, and PreviewRenderContext< OverPixelOp >.

◆ drawCircle()

virtual void IRenderContext::drawCircle ( const Coords  center,
const float  radius 
)
pure virtual

◆ drawLine()

virtual void IRenderContext::drawLine ( const Coords  p1,
const Coords  p2 
)
pure virtual

◆ drawText() [1/2]

virtual void IRenderContext::drawText ( const Coords  p,
const Flags< TextAlign align,
const std::string &  s 
)
pure virtual

◆ drawText() [2/2]

virtual void IRenderContext::drawText ( const Coords  p,
const Flags< TextAlign align,
const std::wstring &  s 
)
pure virtual

◆ drawTriangle()

virtual void IRenderContext::drawTriangle ( const Coords  p1,
const Coords  p2,
const Coords  p3 
)
pure virtual

◆ fill()

virtual void IRenderContext::fill ( const Rgba color)
pure virtual

Fills the whole canvas with given color.

This erases any previous content.

Implemented in FlippedRenderContext, WxRenderContext, PreviewRenderContext< PixelOp >, and PreviewRenderContext< OverPixelOp >.

◆ getLabels()

virtual Array<IRenderOutput::Label> IRenderContext::getLabels ( ) const
inlinevirtual

Reimplemented in PreviewRenderContext< PixelOp >, and PreviewRenderContext< OverPixelOp >.

Definition at line 56 of file RenderContext.h.

◆ setColor()

virtual void IRenderContext::setColor ( const Rgba color,
const Flags< ColorFlag flags 
)
pure virtual

Selects the color for one or more drawing modes.

Implemented in FlippedRenderContext, WxRenderContext, PreviewRenderContext< PixelOp >, and PreviewRenderContext< OverPixelOp >.

◆ setFontSize()

virtual void IRenderContext::setFontSize ( const int  fontSize)
pure virtual

◆ setThickness()

virtual void IRenderContext::setThickness ( const float  thickness)
pure virtual

Modifies the thickness of the lines.

Implemented in FlippedRenderContext, PreviewRenderContext< PixelOp >, and PreviewRenderContext< OverPixelOp >.

◆ size()

virtual Pixel IRenderContext::size ( ) const
pure virtual

Returns the size of the canvas associated with the context.

Implemented in FlippedRenderContext, WxRenderContext, PreviewRenderContext< PixelOp >, and PreviewRenderContext< OverPixelOp >.


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