Libraries/Graphics/src/include/Graphics/Drawing/Command.h File Reference
#include <WString.h>
Include dependency graph for Libraries/Graphics/src/include/Graphics/Drawing/Command.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Graphics
 
 Graphics::Drawing
 

Macros

#define GRAPHICS_DRAWING_COMMAND_MAP(XX)
 Drawing operations. More...
 
#define XX(cmd, args, desc)   cmd,
 

Enumerations

enum  Graphics::Drawing::Command : uint8_t { Graphics::Drawing::Command::XX }
 

Functions

String toString (Graphics::Drawing::Command cmd)
 

Macro Definition Documentation

◆ GRAPHICS_DRAWING_COMMAND_MAP

#define GRAPHICS_DRAWING_COMMAND_MAP (   XX)
Value:
XX(reset, "", "Reset registers to default") \
XX(push, "", "Push all registers to stack") \
XX(pop, "", "Pop all registers from stack") \
XX(storePen, "id", "Store penColor and width to slot") \
XX(storeBrush, "id", "Store brushColor to slot") \
XX(incx, "pt2", "++x2") \
XX(decx, "pt2", "--x2") \
XX(incy, "pt2", "++y2") \
XX(decy, "pt2", "--y2") \
XX(move, "pt1, pt2", "Set pt2 = pt1") \
XX(setPixel, "pt2", "Set pixel colour") \
XX(line, "pt1, pt2, penId", "Draw line") \
XX(lineto, "pt1, pt2, penId", "Draw line then set pt1 = pt2") \
XX(drawRect, "pt1, pt2, radius, penId", "Draw rect with optional rounded corners") \
XX(fillRect, "pt1, pt2, radius, brushId", "Fill rect with optional rounded corners") \
XX(drawEllipse, "pt1, pt2, penId", "Draw ellipse within rectangle") \
XX(fillEllipse, "pt1, pt2, brushId", "Fill ellipse within rectangle") \
XX(drawArc, "pt1, pt2, startAngle, endAngle, penId", "Draw arc within rectangle from startAngle -> endAngle") \
XX(fillArc, "pt1, pt2, startAngle, endAngle, brushId", "Fill arc within rectangle from startAngle -> endAngle") \
XX(drawCircle, "pt2, radius, penId", "Draw circle centred at pt2 with radius") \
XX(fillCircle, "pt2, radius, brushId", "Draw circle centred at pt2 with radius") \
XX(beginSub, "id", "Start a subroutine") \
XX(endSub, "", "End a subroutine") \
XX(call, "id", "Call a subroutine") \
XX(drawText, "id", "Draw text asset from offset to length")

Drawing operations.

pt1 is cursor position, set by move command pt2 is new position, set by parameters

Commands may interpret these as corners of a rectangle (e.g. ellipse)

For example:

    reset
    xabs  12
    yabs  100
    move
    xrel  100
    color yellow
width 3
    line

    x = -5
    color = red
    width = 3
    line

◆ XX

#define XX (   cmd,
  args,
  desc 
)    cmd,

Function Documentation

◆ toString()

#define XX(cmd, args, desc)
Definition: Libraries/Graphics/src/include/Graphics/Drawing/Command.h:123