12 void drawLineLow(
int x0,
int y0,
int x1,
int y1, uint8_t R, uint8_t G, uint8_t B);
15 void drawLineHigh(
int x0,
int y0,
int x1,
int y1, uint8_t R, uint8_t G, uint8_t B);
28 void drawChar(
char c,
int x0,
int y0,
int* dx,
int* dy, std::string relpath);
38 uint8_t* dataInternal;
70 void read(std::string fname);
80 void write(std::string fname);
91 void setPixel(
int x,
int y, uint8_t R, uint8_t G, uint8_t B);
104 void fillRect(
int x0,
int y0,
int w,
int h, uint8_t R, uint8_t G, uint8_t B);
113 void clearRect(uint8_t R, uint8_t G, uint8_t B);
127 void drawRect(
int x0,
int y0,
int w,
int h,
128 uint8_t R, uint8_t G, uint8_t B, uint8_t line_w);
141 void drawLine(
int x0,
int y0,
int x1,
int y1, uint8_t R, uint8_t G, uint8_t B);
156 void drawLine(
int x0,
int y0,
int x1,
int y1,
int thickness, uint8_t R, uint8_t G, uint8_t B);
168 void fillCircle(
int cx,
int cy,
double r, uint8_t R, uint8_t G, uint8_t B);
177 void drawString(std::string s,
int x0,
int y0, std::string relpath);
void drawString(std::string s, int x0, int y0, std::string relpath)
Draw a character at a string at a position.
A simple library for 2D drawing in C++, by Chris Tralie.
Definition: simplecanvas.h:9
void fillCircle(int cx, int cy, double r, uint8_t R, uint8_t G, uint8_t B)
Fill in a solid disc of a particular color.
void fillRect(int x0, int y0, int w, int h, uint8_t R, uint8_t G, uint8_t B)
Fill a solid rectangle with a color.
void setPixel(int x, int y, uint8_t R, uint8_t G, uint8_t B)
Set the color of a particular pixel.
void read(std::string fname)
Read in a ppm file. Use ffmpeg to convert the file to a temporary .ppm file if it has a non ppm exten...
SimpleCanvas(std::string fname)
Construct a new image object from a file.
void drawLine(int x0, int y0, int x1, int y1, uint8_t R, uint8_t G, uint8_t B)
Draw a thin line from one point to another.
~SimpleCanvas()
Destroy the Simple Image object by de-allocating the pixel data.
void clearRect(uint8_t R, uint8_t G, uint8_t B)
Clear the entire canvas to be one color.
void drawRect(int x0, int y0, int w, int h, uint8_t R, uint8_t G, uint8_t B, uint8_t line_w)
Draw the outline of a rectangle with a particular color.
void write(std::string fname)