15#include <ds_surface.h>
356 drawRoundedRectangleAA(rect, color, thickness, corner_radius, corner_radius, corner_radius, corner_radius);
382 if (corner_radius > 0)
594 void moveClipRegions(
const DsFPoint &offset);
595 static bool clipLine(
const DsRect &bounds, int32_t &x0, int32_t &y0, int32_t &x1, int32_t &y1);
608 uint32_t mSsCoeffLog2;
613 ds_scanline_t mScanlineBuffers[2];
616 uint8_t* mScanlineAlpha;
619 uint8_t mClipRegionCount;
621 DsRenderer(
const void* memory,
const void* memory_aa, uint32_t width, uint32_t height);
623 void scanline_blend(int32_t y, int32_t xl, int32_t xr);
624 void render_line_h(int32_t y, int32_t x0, int32_t x1,
DsColor color);
625 void render_line_v(int32_t x, int32_t y0, int32_t y1,
DsColor color);
627 void scanline_clear_aa(ds_scanline_t* line);
628 void scanline_blend_init_aa(
DsColor color);
629 void scanline_blend_aa(ds_scanline_t* line, int32_t y, int32_t xoff);
630 void scanline_draw_aa(
float y,
float xl,
float xr, ds_scanline_t* line, int32_t xoff);
DsAlignment is a class representing both horizontal and vertical alignment type.
Definition ds_types.h:130
DsColor is a class that represents a 4 channel color (Alpha, Red, Green, Blue).
Definition ds_color.h:53
DsEllipse is a class that represents a 2D ellipse (Xc, Yc, Rx, Ry)
Definition ds_geometry.h:2636
DsFPoint is a class that represents the X and Y 2D coordinates of a point as floating point numbers.
Definition ds_geometry.h:397
DsFRect is a class that represents a 2D rectangle (X, Y, W, H) using floating point coordiantes and s...
Definition ds_geometry.h:2059
DsPoint is a class that represents the X and Y 2D coordinates of a point as integer numbers.
Definition ds_geometry.h:24
DsRect is a class that represents a 2D rectangle (X, Y, W, H)
Definition ds_geometry.h:1507
Definition ds_geometry.h:1492
DsRenderer is a class that implements all the drawing operations.
Definition ds_renderer.h:42
void unrollClipRegions(uint8_t level)
Unrolls the clipping region stack back to a specific number of clip regions.
void drawEllipse(DsEllipse ellipse, float thickness, DsColor color)
Draws a non-antialiased ellipse of specified thickness.
void drawRoundedRectangle(DsRect rect, DsColor color, uint16_t corner_radius_tl, uint16_t corner_radius_tr, uint16_t corner_radius_br, uint16_t corner_radius_bl)
Draws a non-antialiased rectangle with rounded corners using lines of thickness 1.
void drawEllipseArc(DsEllipse ellipse, float thickness, float start_angle, float end_angle, DsColor color)
Draws a non-antialiased ellipse arc of specified thickness.
void clearClipRegions(void)
Clears all the clipping regions.
void drawEllipseArcAA(DsEllipse ellipse, float thickness, float start, float end, DsColor color)
Draws an antialiased ellipse arc of specified thickness.
void fillRoundedRectangle(DsRect rect, DsColor color, uint16_t corner_radius)
Fills a rectangle with rounded corners using the specified color.
Definition ds_renderer.h:165
void drawCircle(DsFPoint center, float radius, float thickness, DsColor color)
Draws a non-antialiased circle of specified thickness.
Definition ds_renderer.h:208
void fillEllipseArcAA(DsEllipse ellipse, float start, float end, DsColor color)
Fills an antialiased ellipse arc.
void fillRoundedRectangle(DsRect rect, DsColor color, uint16_t corner_radius_tl, uint16_t corner_radius_tr, uint16_t corner_radius_br, uint16_t corner_radius_bl)
Fills a rectangle with rounded corners using the specified color.
void drawRoundedRectangleAA(DsFRect rect, DsColor color, float thickness, float corner_radius_tl, float corner_radius_tr, float corner_radius_br, float corner_radius_bl)
Draws an antialiased rectangle with rounded corners and lines of specified thickness.
void fillCircle(DsFPoint center, float radius, DsColor color)
Fills a non-antialiased circle.
Definition ds_renderer.h:219
void drawRoundedRectangleAA(DsFRect rect, DsColor color, float thickness, float corner_radius)
Draws an antialiased rectangle with rounded corners and lines of specified thickness.
Definition ds_renderer.h:354
DsSurface & getSurface(void)
Gets the underlying surface used for drawing.
void drawRoundedRectangle(DsRect rect, DsColor color, uint16_t corner_radius)
Draws a non-antialiased rectangle with rounded corners using lines of thickness 1.
Definition ds_renderer.h:131
void drawEllipseAA(DsEllipse ellipse, float thickness, DsColor color)
Draws an antialiased ellipse of specified thickness.
void drawPolyAA(const DsFPoint *points, uint32_t np, float thickness, DsColor color)
Draws an antialiased closed polygon using lines of specified thickness.
void popClipRegion(void)
Pops a clipping region from the clipping region stack.
DsRect renderTextAligned(const DsRect &boundary, const DsAlignment &alignment, const DsPoint &offset, const ds_bitmap_font_t *font, DsColor color, const char *text, size_t length=DsString::npos)
Renders text in aligned mode.
void fillEllipse(DsEllipse ellipse, DsColor color)
Fills a non-antialiased ellipse.
void drawCircleArc(DsFPoint center, float radius, float thickness, float start_angle, float end_angle, DsColor color)
Draws a non-antialiased circle arc of specified thickness.
Definition ds_renderer.h:284
void drawCircleArcAA(DsFPoint center, float radius, float thickness, float start, float end, DsColor color)
Draws an antialiased circle arc of specified thickness.
Definition ds_renderer.h:485
void fillCircleArc(DsFPoint center, float radius, float start_angle, float end_angle, DsColor color)
Fills a non-antialiased circle arc.
Definition ds_renderer.h:299
void drawRectangle(DsRect rect, uint16_t thickness, DsColor color)
Draws a rectangle with lines of specified thickness.
void drawLine(DsPoint p0, DsPoint p1, DsColor color)
Draws a non-antialiased line of thickness 1 in between two points.
void fillEllipseAA(DsEllipse ellipse, DsColor color)
Fills an antialiased ellipse.
DsRect renderTextCentered(DsPoint pos, const ds_bitmap_font_t *font, DsColor color, const char *text, size_t length=DsString::npos)
Renders text centered on a point.
void fillRoundedRectangleAA(DsFRect rect, DsColor color, float corner_radius)
Fills an antialiased rectangle with rounded corners using the specified color.
Definition ds_renderer.h:380
void fillEllipseArc(DsEllipse ellipse, float start_angle, float end_angle, DsColor color)
Fills a non-antialiased ellipse arc.
void drawLineAA(const DsFPoint &p0, const DsFPoint &p1, float thickness, DsColor color)
Draws an antialiased line of specified thickness between two points.
DsRect renderMultilineTextAligned(const DsRect &boundary, const DsAlignment &text_alignment, const DsPoint &offset, const ds_bitmap_font_t *font, DsColor color, const DsAlignment &line_alignment, float row_spacing, const char *text, size_t length=DsString::npos)
Renders multiline text in aligned mode. It does this by interpreting the CR and LF characters.
void fillPoly(const DsPoint *points, uint32_t np, DsColor color)
Fills a non-antialiased closed polygon.
DsRenderer newRenderer(DsSurface &surface)
Creates a new child renderer for the specified surface.
void setSupersampling(int32_t ss)
Sets the supersampling factor.
void drawCircleAA(DsFPoint center, float radius, float thickness, DsColor color)
Draws an antialiased circle of specified thickness.
Definition ds_renderer.h:431
void fillCircleAA(DsFPoint center, float radius, DsColor color)
Fills an antialiased circle.
Definition ds_renderer.h:442
DsRect renderMultilineTextCentered(DsPoint pos, const ds_bitmap_font_t *font, DsColor color, const DsAlignment &line_alignment, float row_spacing, const char *text, size_t length=DsString::npos)
Renders multiline text centered on a point. It does this by interpreting the CR and LF characters.
void fillRectangle(DsRect rect, DsColor color)
Fills a rectangle using the specified color.
void fillPolyAA(const DsFPoint *points, uint32_t np, DsColor color)
Fills an antialiased closed polygon.
void fillRoundedRectangleAA(DsFRect rect, DsColor color, float corner_radius_tl, float corner_radius_tr, float corner_radius_br, float corner_radius_bl)
Fills an antialiased rectangle with rounded corners using the specified color.
void setSurface(DsSurface &surface)
Sets the underlying surface used for drawing.
void drawPoly(const DsPoint *points, uint32_t np, DsColor color)
Draws a non-antialiased closed polygon using lines of thickness 1.
DsRect renderText(DsPoint pos, const ds_bitmap_font_t *font, DsColor color, const char *text, size_t length=DsString::npos)
Renders text.
void fillRectangleAA(DsFRect rect, DsColor color)
Fills an antialiased rectangle using the specified color.
Definition ds_renderer.h:340
DsRect renderMultilineText(DsPoint pos, const ds_bitmap_font_t *font, DsColor color, const DsAlignment &line_alignment, float row_spacing, const char *text, size_t length=DsString::npos)
Renders multiline text. It does this by interpreting the CR and LF characters.
void pushClipRegion(DsRegion ®ion)
Pushes a clipping region to the clipping region stack.
void fillCircleArcAA(DsFPoint center, float radius, float start, float end, DsColor color)
Fills an antialiased circle arc.
Definition ds_renderer.h:500
DsScreen is class of type DsView (inherits from DsView) that implements a physical screen.
Definition ds_screen.h:29
DsSize is class that represents the 2D size of a graphic object (width, height) as integer values.
Definition ds_geometry.h:780
static const size_t npos
Constant representing an invalid position/size value.
Definition ds_string.h:28
DsSurface is a class that represents a drawing surface.
Definition ds_surface.h:30