m5stack-avatar
Loading...
Searching...
No Matches
DrawingUtils.hpp File Reference

drawing utils including geometry handling More...

#include <BoundingRect.h>
#include <DrawContext.h>
#include <Drawable.h>
Include dependency graph for DrawingUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void m5avatar::rotatePoint (float &x, float &y, float angle)
 
void m5avatar::rotatePointAround (float &x, float &y, float angle, float cx, float cy)
 
void m5avatar::fillRotatedRect (M5Canvas *canvas, uint16_t cx, uint16_t cy, uint16_t w, uint16_t h, float angle, uint16_t color)
 
void m5avatar::fillRectRotatedAround (M5Canvas *canvas, float top_left_x, float top_left_y, float bottom_right_x, float bottom_right_y, float angle, uint16_t cx, uint16_t cy, uint16_t color)
 
void m5avatar::computeParamsOfCirclePassingThroughThreePoints (float &r, float &cx, float &cy, float x1, float y1, float x2, float y2, float x3, float y3)
 compute circle parameters though 3 points, (x1,y1), (x2,y2), and (x3,y3) More...
 
void m5avatar::computeAnglesOfArcPassingThroughThreePoints (float &min_angle, float &max_angle, float &via_angle, float x1, float y1, float x2, float y2, float via_x, float via_y, float cx, float cy)
 
void m5avatar::drawCircle (M5Canvas *canvas, float x1, float y1, float x2, float y2, float x3, float y3, uint16_t color)
 
void m5avatar::drawArc (M5Canvas *canvas, float x1, float y1, float x2, float y2, float via_x, float via_y, uint8_t thickness=4, uint16_t color=0xffff, uint8_t offset=0)
 draw arc with three waypoints More...
 
void m5avatar::fillArc (M5Canvas *canvas, float x1, float y1, float x2, float y2, float via_x, float via_y, uint8_t thickness, uint16_t color, uint8_t offset)
 

Detailed Description

drawing utils including geometry handling

Author
botamochi (botam.nosp@m.ochi.nosp@m.6277@.nosp@m.gmai.nosp@m.l.com)
Version
0.1
Date
2024-07-28

Function Documentation

◆ computeParamsOfCirclePassingThroughThreePoints()

void m5avatar::computeParamsOfCirclePassingThroughThreePoints ( float &  r,
float &  cx,
float &  cy,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
)

compute circle parameters though 3 points, (x1,y1), (x2,y2), and (x3,y3)

Parameters
rradius
cxcenter of x
cycenter of y
x1
y1
x2
y2
x3
y3

◆ drawArc()

void m5avatar::drawArc ( M5Canvas *  canvas,
float  x1,
float  y1,
float  x2,
float  y2,
float  via_x,
float  via_y,
uint8_t  thickness = 4,
uint16_t  color = 0xffff,
uint8_t  offset = 0 
)

draw arc with three waypoints

Parameters
canvas
x1
y1
x2
y2
x3
y3
thickness
clockwise
color