SPH
Public Member Functions | Protected Attributes | List of all members
PreviewRenderContext< PixelOp > Class Template Reference

#include <RenderContext.h>

Inheritance diagram for PreviewRenderContext< PixelOp >:
IRenderContext Polymorphic

Public Member Functions

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

Protected Attributes

PixelOp pixelOp
 
Bitmap< Rgba > & bitmap
 
Array< IRenderOutput::Labellabels
 
struct {
   Rgba   line = Rgba::black()
 
   Rgba   fill = Rgba::black()
 
   Rgba   text = Rgba::white()
 
colors
 
float thickness = 1._f
 
int fontSize = 9
 

Detailed Description

template<typename PixelOp>
class PreviewRenderContext< PixelOp >

Definition at line 74 of file RenderContext.h.

Constructor & Destructor Documentation

◆ PreviewRenderContext()

template<typename PixelOp >
PreviewRenderContext< PixelOp >::PreviewRenderContext ( Bitmap< Rgba > &  bitmap)
inlineexplicit

Definition at line 93 of file RenderContext.h.

Member Function Documentation

◆ drawBitmap()

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::drawBitmap ( const Coords  p,
const Bitmap< Rgba > &  bitmap 
)
overridevirtual

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

Implements IRenderContext.

Definition at line 142 of file RenderContext.cpp.

◆ drawCircle()

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::drawCircle ( const Coords  center,
const float  radius 
)
overridevirtual

Draws a circle, given its center and a radius.

Implements IRenderContext.

Reimplemented in SmoothedRenderContext, and AntiAliasedRenderContext.

Definition at line 64 of file RenderContext.cpp.

◆ drawLine()

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::drawLine ( const Coords  p1,
const Coords  p2 
)
overridevirtual

Draws a line connecting two points.

Implements IRenderContext.

Definition at line 35 of file RenderContext.cpp.

◆ drawText() [1/2]

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::drawText ( const Coords  p,
const Flags< TextAlign align,
const std::string &  s 
)
overridevirtual

Implements IRenderContext.

Definition at line 151 of file RenderContext.cpp.

◆ drawText() [2/2]

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::drawText ( const Coords  p,
const Flags< TextAlign align,
const std::wstring &  s 
)
overridevirtual

Implements IRenderContext.

Definition at line 159 of file RenderContext.cpp.

◆ drawTriangle()

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::drawTriangle ( const Coords  p1,
const Coords  p2,
const Coords  p3 
)
overridevirtual

Draws a triangle given three points.

Implements IRenderContext.

Definition at line 99 of file RenderContext.cpp.

◆ fill()

template<typename PixelOp >
virtual void PreviewRenderContext< PixelOp >::fill ( const Rgba color)
overridevirtual

Fills the whole canvas with given color.

This erases any previous content.

Implements IRenderContext.

◆ getLabels()

template<typename PixelOp >
virtual Array<IRenderOutput::Label> PreviewRenderContext< PixelOp >::getLabels ( ) const
inlineoverridevirtual

Reimplemented from IRenderContext.

Definition at line 120 of file RenderContext.h.

◆ setColor()

template<typename PixelOp >
NAMESPACE_SPH_BEGIN void PreviewRenderContext< PixelOp >::setColor ( const Rgba color,
const Flags< ColorFlag flags 
)
overridevirtual

Selects the color for one or more drawing modes.

Implements IRenderContext.

Definition at line 6 of file RenderContext.cpp.

◆ setFontSize()

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::setFontSize ( const int  newFontSize)
overridevirtual

Implements IRenderContext.

Definition at line 25 of file RenderContext.cpp.

◆ setThickness()

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::setThickness ( const float  thickness)
overridevirtual

Modifies the thickness of the lines.

Implements IRenderContext.

Definition at line 20 of file RenderContext.cpp.

◆ size()

template<typename PixelOp >
virtual Pixel PreviewRenderContext< PixelOp >::size ( ) const
inlineoverridevirtual

Returns the size of the canvas associated with the context.

Implements IRenderContext.

Definition at line 96 of file RenderContext.h.

Member Data Documentation

◆ bitmap

template<typename PixelOp >
Bitmap<Rgba>& PreviewRenderContext< PixelOp >::bitmap
protected

Definition at line 78 of file RenderContext.h.

◆ 

struct { ... } PreviewRenderContext< PixelOp >::colors

◆ fill

template<typename PixelOp >
void PreviewRenderContext< PixelOp >::fill = Rgba::black()

Definition at line 84 of file RenderContext.h.

◆ fontSize

template<typename PixelOp >
int PreviewRenderContext< PixelOp >::fontSize = 9
protected

Definition at line 90 of file RenderContext.h.

◆ labels

template<typename PixelOp >
Array<IRenderOutput::Label> PreviewRenderContext< PixelOp >::labels
protected

Definition at line 80 of file RenderContext.h.

◆ line

template<typename PixelOp >
Rgba PreviewRenderContext< PixelOp >::line = Rgba::black()

Definition at line 83 of file RenderContext.h.

◆ pixelOp

template<typename PixelOp >
PixelOp PreviewRenderContext< PixelOp >::pixelOp
protected

Definition at line 76 of file RenderContext.h.

◆ text

template<typename PixelOp >
Rgba PreviewRenderContext< PixelOp >::text = Rgba::white()

Definition at line 85 of file RenderContext.h.

◆ thickness

template<typename PixelOp >
float PreviewRenderContext< PixelOp >::thickness = 1._f
protected

Definition at line 88 of file RenderContext.h.


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