69 return color.
over(prev);
73 template <
typename PixelOp>
102 virtual void setThickness(
const float newThickness)
override;
104 virtual void setFontSize(
const int newFontSize)
override;
125 void drawSafe(
const Pixel p,
const Rgba c) {
132 this->drawSafe(
Pixel(p), c);
140 this->draw(
Pixel(p), c);
188 brush = dc.GetBrush();
192 const wxSize s = dc.GetSize();
193 return Pixel(s.x, s.y);
198 pen.SetColour(wxColour(color));
202 brush.SetColour(wxColour(color));
206 dc.SetTextForeground(wxColour(color));
214 wxFont font = dc.GetFont();
215 font.SetPointSize(newFontSize);
220 brush.SetColour(wxColour(color));
222 dc.DrawRectangle(wxPoint(0, 0), dc.GetSize());
226 dc.DrawLine(wxPoint(p1), wxPoint(p2));
230 dc.DrawCircle(wxPoint(center),
int(
radius));
242 std::wstring ws(s.begin(), s.end());
250 label.
fontSize = dc.GetFont().GetPointSize();
251 label.
color =
Rgba(dc.GetTextForeground());
#define NOT_IMPLEMENTED
Helper macro marking missing implementation.
Wrapper of wxBitmap, will be possibly replaced by custom implementation.
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
void printLabels(wxDC &dc, ArrayView< const IRenderOutput::Label > labels)
Random utility functions for drawing stuff to DC.
void drawSafe(const Pixel p, const Rgba c)
virtual void drawCircle(const Coords center, const float radius) override
Draws a circle, given its center and a radius.
AntiAliasedRenderContext(Bitmap< Rgba > &bitmap)
Array clone() const
Performs a deep copy of all elements of the array.
Wrapper of an integral value providing functions for reading and modifying individual bits.
constexpr INLINE bool has(const TEnum flag) const
Checks if the object has a given flag.
Abstraction of a device used for rendering.
virtual void setFontSize(const int fontSize)=0
virtual void drawCircle(const Coords center, const float radius)=0
Draws a circle, given its center and a radius.
virtual void drawLine(const Coords p1, const Coords p2)=0
Draws a line connecting two points.
virtual void drawText(const Coords p, const Flags< TextAlign > align, const std::string &s)=0
virtual void drawTriangle(const Coords p1, const Coords p2, const Coords p3)=0
Draws a triangle given three points.
virtual void drawText(const Coords p, const Flags< TextAlign > align, const std::wstring &s)=0
virtual void setColor(const Rgba &color, const Flags< ColorFlag > flags)=0
Selects the color for one or more drawing modes.
virtual Array< IRenderOutput::Label > getLabels() const
virtual void setThickness(const float thickness)=0
Modifies the thickness of the lines.
virtual void drawBitmap(const Coords p, const Bitmap< Rgba > &bitmap)=0
Draws a bitmap, given the position of its left-top corner.
virtual void fill(const Rgba &color)=0
Fills the whole canvas with given color.
virtual Pixel size() const =0
Returns the size of the canvas associated with the context.
virtual void drawCircle(const Coords center, const float radius) override
Draws a circle, given its center and a radius.
virtual Array< IRenderOutput::Label > getLabels() const override
virtual void setColor(const Rgba &color, const Flags< ColorFlag > flags) override
Selects the color for one or more drawing modes.
virtual void fill(const Rgba &color) override
Fills the whole canvas with given color.
PreviewRenderContext(Bitmap< Rgba > &bitmap)
virtual void setThickness(const float newThickness) override
Modifies the thickness of the lines.
virtual void drawTriangle(const Coords p1, const Coords p2, const Coords p3) override
Draws a triangle given three points.
virtual void drawBitmap(const Coords p, const Bitmap< Rgba > &subBitmap) override
Draws a bitmap, given the position of its left-top corner.
Array< IRenderOutput::Label > labels
virtual void drawText(const Coords p, const Flags< TextAlign > align, const std::string &s) override
virtual void setFontSize(const int newFontSize) override
struct PreviewRenderContext::@28 colors
virtual Pixel size() const override
Returns the size of the canvas associated with the context.
virtual void drawLine(const Coords p1, const Coords p2) override
Draws a line connecting two points.
Rgba over(const Rgba &other) const
Blends two colors together using "over" operation.
SmoothedRenderContext(Bitmap< Rgba > &bitmap, const LutKernel< 2 > &kernel)
virtual void drawCircle(const Coords center, const float radius) override
Draws a circle, given its center and a radius.
Render context drawing directly into wxDC.
virtual void drawLine(const Coords p1, const Coords p2) override
Draws a line connecting two points.
WxRenderContext(wxDC &dc)
virtual void drawText(const Coords p, const Flags< TextAlign > align, const std::string &s) override
virtual void setColor(const Rgba &color, const Flags< ColorFlag > flags) override
Selects the color for one or more drawing modes.
virtual Pixel size() const override
Returns the size of the canvas associated with the context.
virtual void drawBitmap(const Coords, const Bitmap< Rgba > &) override
Draws a bitmap, given the position of its left-top corner.
virtual void drawTriangle(const Coords, const Coords, const Coords) override
Draws a triangle given three points.
virtual void setThickness(const float UNUSED(newThickness)) override
virtual void fill(const Rgba &color) override
Fills the whole canvas with given color.
virtual void drawText(const Coords p, const Flags< TextAlign > align, const std::wstring &s) override
virtual void setFontSize(const int newFontSize) override
virtual void drawCircle(const Coords center, const float radius) override
Draws a circle, given its center and a radius.
INLINE Rgba operator()(const Rgba &prev, const Rgba &color) const
INLINE Rgba operator()(const Rgba &, const Rgba &color) const
Base class for all polymorphic objects.