143 template<
typename color_t>
148 static_assert(is_color<color_t>::value,
"color_t must be one of the color types defined in Color.h");
151 template<
typename>
friend class Image;
159 #if (MTOOLS_TGX_EXTENSIONS)
160 #include <mtools/extensions/tgx/tgx_ext_Image.inl>
340 inline TGX_INLINE
bool isValid()
const {
return (_buffer !=
nullptr); }
356 inline TGX_INLINE
int width()
const {
return _lx; }
364 inline TGX_INLINE
int lx()
const {
return _lx; }
372 inline TGX_INLINE
int height()
const {
return _ly; }
380 inline TGX_INLINE
int ly()
const {
return _ly; }
388 inline TGX_INLINE
int stride()
const {
return _stride; }
414 inline TGX_INLINE
const color_t *
data()
const {
return _buffer; }
424 inline TGX_INLINE color_t *
data() {
return _buffer; }
455 template<
bool CHECKRANGE = true> TGX_INLINE
inline void drawPixel(
iVec2 pos, color_t color) {
if ((CHECKRANGE) && (!
isValid()))
return; _drawPixel<CHECKRANGE>(pos, color); }
467 template<
bool CHECKRANGE = true> TGX_INLINE
inline void drawPixelf(
fVec2 pos, color_t color) {
if ((CHECKRANGE) && (!
isValid()))
return; _drawPixel<CHECKRANGE>({ (int32_t)roundf(pos.
x) , (int32_t)roundf(pos.
y) }, color); }
481 template<
bool CHECKRANGE = true> TGX_INLINE
inline void drawPixel(
iVec2 pos, color_t color,
float opacity) {
if ((CHECKRANGE) && (!
isValid()))
return; _drawPixel<CHECKRANGE,true>(pos, color, opacity); }
497 template<
bool CHECKRANGE = true> TGX_INLINE
inline void drawPixelf(
fVec2 pos, color_t color,
float opacity) {
if ((CHECKRANGE) && (!
isValid()))
return; _drawPixel<CHECKRANGE, true>({ (int32_t)roundf(pos.
x) , (int32_t)roundf(pos.
y) }, color, opacity); }
510 template<
bool CHECKRANGE = true> TGX_INLINE
inline color_t
readPixel(
iVec2 pos, color_t outside_color = color_t())
const {
if ((CHECKRANGE) && (!
isValid()))
return outside_color;
return _readPixel(pos, outside_color); }
525 template<
bool CHECKRANGE = true> TGX_INLINE
inline color_t
readPixelf(
fVec2 pos, color_t outside_color = color_t())
const {
if ((CHECKRANGE) && (!
isValid()))
return outside_color;
return _readPixel({ (int32_t)roundf(pos.
x) , (int32_t)roundf(pos.
y) }, outside_color); }
537 TGX_INLINE
inline const color_t&
operator()(
iVec2 pos)
const {
return _buffer[TGX_CAST32(pos.
x) + TGX_CAST32(_stride) * TGX_CAST32(pos.
y)]; }
548 TGX_INLINE
inline color_t&
operator()(
iVec2 pos) {
return _buffer[TGX_CAST32(pos.
x) + TGX_CAST32(_stride) * TGX_CAST32(pos.
y)]; }
561 TGX_INLINE
inline const color_t&
operator()(
int x,
int y)
const {
return _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)]; }
574 TGX_INLINE
inline color_t&
operator()(
int x,
int y) {
return _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)];}
602 template<
typename ITERFUN>
void iterate(ITERFUN cb_fun);
619 template<
typename ITERFUN>
void iterate(ITERFUN cb_fun)
const;
709 template<
typename color_t_src,
typename BLEND_OPERATOR>
754 template<
typename color_t_src,
typename BLEND_OPERATOR>
818 template<
typename color_t_src,
int CACHE_SIZE = TGX_PROGMEM_DEFAULT_CACHE_SIZE>
846 template<
typename color_t_src,
typename BLEND_OPERATOR,
int CACHE_SIZE = TGX_PROGMEM_DEFAULT_CACHE_SIZE>
881 template<
typename color_t_src,
int CACHE_SIZE = TGX_PROGMEM_DEFAULT_CACHE_SIZE>
976 template<
typename color_dst>
1055 template<
int STACK_SIZE = 1024>
int fill(
iVec2 start_pos, color_t new_color);
1080 template<
int STACK_SIZE = 1024>
int fill(
iVec2 start_pos, color_t border_color, color_t new_color);
1212#ifndef DOXYGEN_EXCLUDE
1230 DEPRECATED(
"Use method drawThickLineAA() instead.")
1231 void drawWideLine(
fVec2 PA,
fVec2 PB,
float w, color_t color,
float opacity) {
drawThickLineAA(PA, PB, w, END_ROUNDED, END_ROUNDED, color, opacity); }
1239 DEPRECATED(
"Use method drawWedgeLineAA() instead.")
1240 void drawWedgeLine(
fVec2 PA,
fVec2 PB,
float aw,
float bw, color_t color,
float opacity) {
drawWedgeLineAA(PA, PB, 2*aw, END_ROUNDED, 2*bw, END_ROUNDED, color, opacity); }
1248 DEPRECATED(
"Use method fillCircleAA() instead")
1249 void drawSpot(fVec2 center,
float r, color_t color,
float opacity) {
fillCircleAA(center, r, color, opacity); }
1415 void fillThickRectAA(
const fBox2& B,
float thickness, color_t color_interior, color_t color_border,
float opacity = 1.0f);
1526 void fillThickRoundRectAA(
const fBox2& B,
float corner_radius,
float thickness, color_t color_interior, color_t color_border,
float opacity = 1.0f);
1678 template<
typename color_alt>
1705 template<
typename color_t_tex>
1741 template<
typename color_t_tex,
typename BLEND_OPERATOR>
1771 template<
typename color_t_tex>
1772 void drawTexturedGradientTriangle(
const Image<color_t_tex>& src_im,
fVec2 srcP1,
fVec2 srcP2,
fVec2 srcP3,
fVec2 dstP1,
fVec2 dstP2,
fVec2 dstP3, color_t_tex C1, color_t_tex C2, color_t_tex C3,
float opacity =
TGX_DEFAULT_NO_BLENDING);
1800 template<
typename color_t_tex>
1835 template<
typename color_t_tex>
1836 void drawTexturedGradientMaskedTriangle(
const Image<color_t_tex>& src_im, color_t_tex transparent_color,
fVec2 srcP1,
fVec2 srcP2,
fVec2 srcP3,
fVec2 dstP1,
fVec2 dstP2,
fVec2 dstP3, color_t_tex C1, color_t_tex C2, color_t_tex C3,
float opacity = 1.0f);
1991 template<
typename color_alt>
2000 template<
typename color_t_tex>
2009 template<
typename color_t_tex,
typename BLEND_OPERATOR>
2018 template<
typename color_t_tex>
2019 void drawTexturedGradientQuad(
const Image<color_t_tex>& src_im,
fVec2 srcP1,
fVec2 srcP2,
fVec2 srcP3,
fVec2 srcP4,
fVec2 dstP1,
fVec2 dstP2,
fVec2 dstP3,
fVec2 dstP4, color_t_tex C1, color_t_tex C2, color_t_tex C3, color_t_tex C4,
float opacity =
TGX_DEFAULT_NO_BLENDING);
2027 template<
typename color_t_tex>
2028 void drawTexturedMaskedQuad(
const Image<color_t_tex>& src_im, color_t_tex transparent_color,
fVec2 srcP1,
fVec2 srcP2,
fVec2 srcP3,
fVec2 srcP4,
fVec2 dstP1,
fVec2 dstP2,
fVec2 dstP3,
fVec2 dstP4,
float opacity = 1.0f);
2036 template<
typename color_t_tex>
2037 void drawTexturedGradientMaskedQuad(
const Image<color_t_tex>& src_im, color_t_tex transparent_color,
fVec2 srcP1,
fVec2 srcP2,
fVec2 srcP3,
fVec2 srcP4,
fVec2 dstP1,
fVec2 dstP2,
fVec2 dstP3,
fVec2 dstP4, color_t_tex C1, color_t_tex C2, color_t_tex C3, color_t_tex C4,
float opacity = 1.0f);
2092 template<
typename FUNCTOR_NEXT>
2143 template<
typename FUNCTOR_NEXT>
2185 template<
typename FUNCTOR_NEXT>
2238 template<
typename FUNCTOR_NEXT>
2278 template<
typename FUNCTOR_NEXT>
2330 template<
typename FUNCTOR_NEXT>
2331 void drawPolygonAA(FUNCTOR_NEXT next_point, color_t color,
float opacity = 1.0f);
2371 template<
typename FUNCTOR_NEXT>
2413 template<
typename FUNCTOR_NEXT>
2414 void fillPolygonAA(FUNCTOR_NEXT next_point, color_t color,
float opacity = 1.0f);
2429 void fillThickPolygonAA(
int nbpoints,
const fVec2 tabPoints[],
float thickness, color_t interior_color, color_t border_color,
float opacity = 1.0f);
2457 template<
typename FUNCTOR_NEXT>
2458 void fillThickPolygonAA(FUNCTOR_NEXT next_point,
float thickness, color_t interior_color, color_t border_color,
float opacity = 1.0f);
2576 void fillThickCircleAA(
fVec2 center,
float r,
float thickness, color_t color_interior, color_t color_border,
float opacity = 1.0f);
2617 void drawCircleArcAA(
fVec2 center,
float r,
float angle_start,
float angle_end, color_t color,
float opacity = 1.0f);
2689 void fillThickCircleSectorAA(
fVec2 center,
float r,
float angle_start,
float angle_end,
float thickness, color_t color_interior, color_t color_border,
float opacity = 1.0f);
2873 template<
int SPLINE_MAX_POINTS = 32>
2894 template<
int SPLINE_MAX_POINTS = 32>
2914 template<
int SPLINE_MAX_POINTS = 32>
2991 template<
int SPLINE_MAX_POINTS = 32>
3016 template<
int SPLINE_MAX_POINTS = 32>
3039 template<
int SPLINE_MAX_POINTS = 32>
3064 template<
int SPLINE_MAX_POINTS = 32>
3095 template<
int SPLINE_MAX_POINTS = 32>
3366#ifndef DOXYGEN_EXCLUDE
3384 DEPRECATED(
"Use new signature: drawText(text, pos, font, color, opacity) or the new method drawTextEx()")
3385 iVec2 drawText(const
char* text,
iVec2 pos, color_t color, const
ILI9341_t3_font_t& font,
bool start_newline_at_0,
float opacity = 1.0f) {
return drawTextEx(text, pos, font, DEFAULT_TEXT_ANCHOR,
false, start_newline_at_0, color, opacity); }
3391 DEPRECATED(
"Use new signature: drawText(text, pos, font, color, opacity) or the new method drawTextEx()")
3392 iVec2 drawText(const
char* text,
iVec2 pos, color_t color, const
GFXfont& font,
bool start_newline_at_0,
float opacity = 1.0f) {
return drawTextEx(text, pos, font, DEFAULT_TEXT_ANCHOR,
false, start_newline_at_0, color, opacity); }
3398 DEPRECATED(
"Use new signature measureText(text,pos,font,anchor, wrap, newline_at_0)")
3399 iBox2
measureText(const
char* text, iVec2 pos, const
GFXfont& font,
bool start_newline_at_0) {
return measureText(text, pos, font, DEFAULT_TEXT_ANCHOR,
false, start_newline_at_0); }
3405 DEPRECATED(
"Use new signature measureText(text,pos,font,anchor, wrap, newline_at_0)")
3406 iBox2
measureText(const
char* text, iVec2 pos, const
ILI9341_t3_font_t& font,
bool start_newline_at_0) {
return measureText(text, pos, font, DEFAULT_TEXT_ANCHOR,
false, start_newline_at_0); }
3442 if ((opacity >= 0) && (opacity < 1))
3444 ofr.set_drawPixel([&](int32_t x, int32_t y, uint16_t c) {
drawPixel({ x,y }, color_t(
RGB565(c)), opacity);
return; });
3445 ofr.set_drawFastHLine([&](int32_t x, int32_t y, int32_t w, uint16_t c) {
drawFastHLine({ x,y }, w, color_t(
RGB565(c)), opacity);
return; });
3449 ofr.set_drawPixel([&](int32_t x, int32_t y, uint16_t c) {
drawPixel({ x,y }, color_t(
RGB565(c)));
return; });
3450 ofr.set_drawFastHLine([&](int32_t x, int32_t y, int32_t w, uint16_t c) {
drawFastHLine({ x,y }, w, color_t(
RGB565(c)));
return; });
3452 ofr.set_startWrite([&](
void) {
return; });
3453 ofr.set_endWrite([&](
void) {
return; });
3508 template<
typename JPEG_T>
int JPEGDecode(JPEG_T& jpeg,
iVec2 topleft =
iVec2(0, 0),
int options = 0,
float opacity = 1.0f);
3569 inline void _checkvalid() {
if ((_lx <= 0) || (_ly <= 0) || (_stride < _lx) || (_buffer ==
nullptr))
setInvalid(); }
3577 static inline void _fast_memset(color_t* p_dest, color_t color, int32_t len);
3579 template<
typename color_t_src>
bool _blitClip(
const Image<color_t_src>& sprite,
int& dest_x,
int& dest_y,
int& sprite_x,
int& sprite_y,
int& sx,
int& sy);
3580 bool _blitClip(
int sprite_lx,
int sprite_ly,
int& dest_x,
int& dest_y,
int& sprite_x,
int& sprite_y,
int& sx,
int& sy);
3582 void _blit(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy);
3583 static void _blitRegion(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy) {
if ((
size_t)pdest <= (
size_t)psrc) _blitRegionUp(pdest, dest_stride, psrc, src_stride, sx, sy);
else _blitRegionDown(pdest, dest_stride, psrc, src_stride, sx, sy); }
3584 static void _blitRegionUp(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy);
3585 static void _blitRegionDown(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy);
3587 void _blit(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3588 static void _blitRegion(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy,
float opacity) {
if ((
size_t)pdest <= (
size_t)psrc) _blitRegionUp(pdest, dest_stride, psrc, src_stride, sx, sy, opacity);
else _blitRegionDown(pdest, dest_stride, psrc, src_stride, sx, sy, opacity); }
3589 static void _blitRegionUp(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy,
float opacity);
3590 static void _blitRegionDown(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy,
float opacity);
3592 template<
typename color_t_src,
typename BLEND_OPERATOR>
void _blit(
const Image<color_t_src>& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
const BLEND_OPERATOR& blend_op);
3593 template<
typename color_t_src,
typename BLEND_OPERATOR>
static void _blitRegion(color_t* pdest,
int dest_stride, color_t_src * psrc,
int src_stride,
int sx,
int sy,
const BLEND_OPERATOR& blend_op) {
if ((
size_t)pdest <= (
size_t)psrc) _blitRegionUp(pdest, dest_stride, psrc, src_stride, sx, sy, blend_op);
else _blitRegionDown(pdest, dest_stride, psrc, src_stride, sx, sy, blend_op); }
3594 template<
typename color_t_src,
typename BLEND_OPERATOR>
static void _blitRegionUp(color_t* pdest,
int dest_stride, color_t_src * psrc,
int src_stride,
int sx,
int sy,
const BLEND_OPERATOR& blend_op);
3595 template<
typename color_t_src,
typename BLEND_OPERATOR>
static void _blitRegionDown(color_t* pdest,
int dest_stride, color_t_src* psrc,
int src_stride,
int sx,
int sy,
const BLEND_OPERATOR& blend_op);
3597 void _blitMasked(
const Image& sprite, color_t transparent_color,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3598 static void _maskRegion(color_t transparent_color, color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy) {
if ((
size_t)pdest <= (
size_t)psrc) _maskRegionUp(transparent_color, pdest, dest_stride, psrc, src_stride, sx, sy);
else _maskRegionDown(transparent_color, pdest, dest_stride, psrc, src_stride, sx, sy); }
3599 static void _maskRegionUp(color_t transparent_color, color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy);
3600 static void _maskRegionDown(color_t transparent_color, color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy);
3601 static void _maskRegion(color_t transparent_color, color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy,
float opacity) {
if ((
size_t)pdest <= (
size_t)psrc) _maskRegionUp(transparent_color, pdest, dest_stride, psrc, src_stride, sx, sy, opacity);
else _maskRegionDown(transparent_color, pdest, dest_stride, psrc, src_stride, sx, sy, opacity); }
3602 static void _maskRegionUp(color_t transparent_color, color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy,
float opacity);
3603 static void _maskRegionDown(color_t transparent_color, color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy,
float opacity);
3605 template<
typename color_t_src,
int CACHE_SIZE,
bool USE_BLENDING,
bool USE_MASK,
bool USE_CUSTOM_OPERATOR,
typename BLEND_OPERATOR>
3606 void _blitScaledRotated(
const Image<color_t_src>& src_im, color_t_src transparent_color, fVec2 anchor_src, fVec2 anchor_dst,
float scale,
float angle_degrees,
float opacity,
const BLEND_OPERATOR& blend_op);
3608 void _blitRotated90(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3609 void _blitRotated180(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3610 void _blitRotated270(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3612 template<
typename color_t_src,
typename BLEND_OPERATOR>
void _blitRotated90blend(
const Image<color_t_src>& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
const BLEND_OPERATOR& blend_op);
3613 template<
typename color_t_src,
typename BLEND_OPERATOR>
void _blitRotated180blend(
const Image<color_t_src>& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
const BLEND_OPERATOR& blend_op);
3614 template<
typename color_t_src,
typename BLEND_OPERATOR>
void _blitRotated270blend(
const Image<color_t_src>& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
const BLEND_OPERATOR& blend_op);
3621 template<
bool UNICOLOR_COMP,
int STACK_SIZE_BYTES>
int _scanfill(
int x,
int y, color_t border_color, color_t new_color);
3629 template<
bool X_MAJOR,
bool BLEND,
int SIDE,
bool CHECKRANGE = false>
inline TGX_INLINE
void _bseg_update_pixel(
const BSeg & seg, color_t color, int32_t op)
3631 const int x = seg.X();
const int y = seg.Y();
3632 if (CHECKRANGE) {
if ((x < 0) || (y < 0) || (x >= _lx) || (y >= _ly))
return; }
3633 if (SIDE != 0) {
const int32_t o = ((seg.AA<SIDE, X_MAJOR>()) * op) >> 8; _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)].blend256(color, (uint32_t)o); }
3634 else if (BLEND) { _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)].blend256(color, (uint32_t)op); }
3635 else { _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)] = color; }
3638 template<
bool CHECKRANGE = false>
inline TGX_INLINE
void _bseg_update_pixel(
const BSeg & seg, color_t color, int32_t op, int32_t aa)
3640 const int x = seg.X();
const int y = seg.Y();
3641 if (CHECKRANGE) {
if ((x < 0) || (y < 0) || (x >= _lx) || (y >= _ly))
return; }
3642 _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)].blend256(color, (uint32_t)((op * aa)>>8));
3646 template<
int SIDE>
void _bseg_draw_template(BSeg& seg,
bool draw_first,
bool draw_last, color_t color, int32_t op,
bool checkrange);
3647 void _bseg_draw(BSeg & seg,
bool draw_first,
bool draw_last, color_t color,
int side, int32_t op,
bool checkrange);
3648 void _bseg_draw_AA(BSeg & seg,
bool draw_first,
bool draw_last, color_t color, int32_t op,
bool checkrange);
3650 template<
int SIDE>
void _bseg_avoid1_template(BSeg& segA,
bool lastA, BSeg& segB,
bool lastB, color_t color, int32_t op,
bool checkrange);
3651 void _bseg_avoid1(BSeg& PQ, BSeg& PA,
bool drawP,
bool drawQ,
bool closedPA, color_t color,
int side, int32_t op,
bool checkrange);
3652 template<
int SIDE>
void _bseg_avoid2_template(BSeg& segA,
bool lastA, BSeg& segB,
bool lastB, BSeg& segC,
bool lastC, color_t color, int32_t op,
bool checkrange);
3653 void _bseg_avoid2(BSeg & PQ, BSeg & PA, BSeg & PB,
bool drawQ,
bool closedPA,
bool closedPB, color_t color,
int side, int32_t op,
bool checkrange);
3654 template<
int SIDE>
void _bseg_avoid11_template(BSeg& segA, BSeg& segB,
bool lastB, BSeg& segD,
bool lastD, color_t color, int32_t op,
bool checkrange);
3655 void _bseg_avoid11(BSeg & PQ, BSeg& PA, BSeg & QB,
bool drawP,
bool drawQ,
bool closedPA,
bool closedQB, color_t color,
int side, int32_t op,
bool checkrange);
3656 template<
int SIDE>
void _bseg_avoid21_template(BSeg& segA, BSeg& segB,
bool lastB, BSeg& segC,
bool lastC, BSeg& segD,
bool lastD, color_t color, int32_t op,
bool checkrange);
3657 void _bseg_avoid21(BSeg& PQ, BSeg& PA, BSeg& PB, BSeg& QC,
bool closedPA,
bool closedPB,
bool closedQC, color_t color,
int side, int32_t op,
bool checkrange);
3658 template<
int SIDE>
void _bseg_avoid22_template(BSeg& segA, BSeg& segB,
bool lastB, BSeg& segC,
bool lastC, BSeg& segD,
bool lastD, BSeg& segE,
bool lastE, color_t color, int32_t op,
bool checkrange);
3659 void _bseg_avoid22(BSeg& PQ, BSeg& PA, BSeg& PB, BSeg& QC, BSeg& QD,
bool closedPA,
bool closedPB,
bool closedQC,
bool closedQD, color_t color,
int side, int32_t op,
bool checkrange);
3665 void _bseg_fill_triangle(fVec2 fP1, fVec2 fP2, fVec2 fP3, color_t fillcolor,
float opacity);
3666 void _bseg_fill_triangle_precomputed(fVec2 fP1, fVec2 fP2, fVec2 fP3, BSeg & seg12, BSeg & seg21, BSeg & seg23, BSeg & seg32, BSeg & seg31, BSeg & seg13, color_t fillcolor,
float opacity);
3667 void _bseg_fill_triangle_precomputed_sub(fVec2 fP1, fVec2 fP2, fVec2 fP3, BSeg & seg12, BSeg & seg21, BSeg & seg23, BSeg & seg32, BSeg & seg31, BSeg & seg13, color_t fillcolor,
float opacity);
3668 void _bseg_fill_interior_angle(iVec2 P, iVec2 Q1, iVec2 Q2, BSeg& seg1, BSeg& seg2, color_t color,
bool fill_last,
float opacity);
3669 void _bseg_fill_interior_angle_sub(
int dir,
int y,
int ytarget, BSeg& sega, BSeg& segb, color_t color,
float opacity);
3671 void _triangle_hline(
int x1,
int x2,
const int y, color_t color,
float opacity)
3674 if (x1 > x2)
return;
3675 color_t* p = _buffer + TGX_CAST32(x1) + TGX_CAST32(y) * TGX_CAST32(_stride);
3676 if (opacity < 0) {
while (x1++ <= x2) { (*p++) = color; } }
else {
while (x1++ <= x2) { (*p++).blend(color,opacity); } }
3679 template<
typename T>
static inline T _triangleAera(Vec2<T> P1, Vec2<T> P2, Vec2<T> P3) {
return P1.x * (P2.y - P3.y) + P2.x * (P3.y - P1.y) + P3.x * (P1.y - P2.y); }
3687 template<
bool CHECKRANGE,
bool CHECK_VALID_BLEND = true> TGX_INLINE
inline void _drawPixel(iVec2 pos, color_t color,
float opacity)
3689 if (CHECKRANGE) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return; }
3690 if ((CHECK_VALID_BLEND) && ((opacity < 0)||(opacity>1))) _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)] = color;
else _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)].blend(color, opacity);
3693 template<
bool CHECKRANGE> TGX_INLINE
inline void _drawPixel(iVec2 pos, color_t color)
3695 if (CHECKRANGE) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return; }
3696 _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)] = color;
3699 TGX_INLINE
inline void _drawPixel(
bool checkrange, iVec2 pos, color_t color,
float opacity)
3701 if (checkrange) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return; }
3702 if ((opacity < 0)||(opacity>1)) _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)] = color;
else _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)].blend(color, opacity);
3705 TGX_INLINE
inline void _drawPixel(
bool checkrange, iVec2 pos, color_t color)
3707 if (checkrange) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return; }
3708 _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)] = color;
3711 template<
bool CHECKRANGE = true> TGX_INLINE
inline color_t _readPixel(iVec2 pos, color_t outside_color)
const
3713 if (CHECKRANGE) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return outside_color; }
3714 return _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)];
3717 template<
bool CHECKRANGE>
void _drawFastVLine(iVec2 pos,
int h, color_t color,
float opacity);
3718 template<
bool CHECKRANGE>
void _drawFastHLine(iVec2 pos,
int w, color_t color,
float opacity);
3719 template<
bool CHECKRANGE>
void _drawFastVLine(iVec2 pos,
int h, color_t color);
3720 template<
bool CHECKRANGE>
void _drawFastHLine(iVec2 pos,
int w, color_t color);
3722 inline TGX_INLINE
void _drawFastVLine(
bool checkrange, iVec2 pos,
int h, color_t color,
float opacity) {
if (checkrange) _drawFastVLine<true>(pos, h, color, opacity);
else _drawFastVLine<false>(pos, h, color, opacity); }
3723 inline TGX_INLINE
void _drawFastHLine(
bool checkrange, iVec2 pos,
int w, color_t color,
float opacity) {
if (checkrange) _drawFastHLine<true>(pos, w, color, opacity);
else _drawFastHLine<false>(pos, w, color, opacity); }
3724 inline TGX_INLINE
void _drawFastVLine(
bool checkrange, iVec2 pos,
int h, color_t color) {
if (checkrange) _drawFastVLine<true>(pos, h, color);
else _drawFastVLine<false>(pos, h, color); }
3725 inline TGX_INLINE
void _drawFastHLine(
bool checkrange, iVec2 pos,
int w, color_t color) {
if (checkrange) _drawFastHLine<true>(pos, w, color);
else _drawFastHLine<false>(pos, w, color); }
3726 inline TGX_INLINE
void _drawSeg(iVec2 P1,
bool drawP1, iVec2 P2,
bool drawP2, color_t color,
float opacity) { BSeg seg(P1, P2); _bseg_draw(seg, drawP1, drawP2, color, 0, (int32_t)(opacity * 256),
true); }
3729 void _drawEnd(
float distAB, fVec2 A, fVec2 B, BSeg& segAB, BSeg& segBA, BSeg& segAP, BSeg& segBQ, EndPath end,
int w, color_t color,
float opacity);
3732 void _drawWedgeLine(
float ax,
float ay,
float bx,
float by,
float aw,
float bw, color_t color,
float opacity);
3733 float _wedgeLineDistance(
float pax,
float pay,
float bax,
float bay,
float dr);
3744 void _fillRect(iBox2 B, color_t color,
float opacity);
3745 template<
bool CHECKRANGE>
void _drawRoundRect(
int x,
int y,
int w,
int h,
int r, color_t color);
3746 template<
bool CHECKRANGE>
void _drawRoundRect(
int x,
int y,
int w,
int h,
int r, color_t color,
float opacity);
3747 template<
bool CHECKRANGE>
void _fillRoundRect(
int x,
int y,
int w,
int h,
int r, color_t color);
3748 template<
bool CHECKRANGE>
void _fillRoundRect(
int x,
int y,
int w,
int h,
int r, color_t color,
float opacity);
3752 void _fillSmoothRect(
const fBox2& B, color_t color,
float opacity);
3753 void _fillSmoothRoundedRect(
const tgx::iBox2& B,
float corner_radius, color_t color,
float opacity);
3754 void _drawSmoothRoundRect(
const tgx::iBox2& B,
float corner_radius, color_t color,
float opacity);
3755 void _drawSmoothWideRoundRect(
const tgx::iBox2& B,
float corner_radius,
float thickness, color_t color,
float opacity);
3768 template<
typename color_alt,
bool USE_BLENDING>
void _drawGradientTriangle(fVec2 P1, fVec2 P2, fVec2 P3, color_alt colorP1, color_alt colorP2, color_alt colorP3,
float opacity);
3769 template<
typename color_t_tex,
bool GRADIENT,
bool USE_BLENDING,
bool MASKED>
void _drawTexturedTriangle(
const Image<color_t_tex>& src_im, color_t_tex transparent_color, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, color_t_tex C1, color_t_tex C2, color_t_tex C3,
float opacity);
3791 template<
bool CHECKRANGE>
void _drawCircleHelper(
int x0,
int y0,
int r,
int cornername, color_t color,
float opacity);
3792 template<
bool CHECKRANGE>
void _fillCircleHelper(
int x0,
int y0,
int r,
int corners,
int delta, color_t color,
float opacity);
3793 template<
bool OUTLINE,
bool FILL,
bool CHECKRANGE>
void _drawFilledCircle(
int xm,
int ym,
int r, color_t color, color_t fillcolor,
float opacity);
3797 static float _rectifyAngle(
float a);
3798 static void _defaultQuarterVH(
int quarter,
int& v,
int& h);
3800 void _fillSmoothQuarterCircleInterHPsub(
tgx::fVec2 C,
float R,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color,
float opacity,
int nb_planes, int32_t kx1 = 0, int32_t ky1 = 0, int32_t off1 = 0, int32_t off1_full = 0, int32_t kx2 = 0, int32_t ky2 = 0, int32_t off2 = 0, int32_t off2_full = 0);
3801 void _fillSmoothQuarterCircleInterHP0(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity);
3802 void _fillSmoothQuarterCircleInterHP1(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg1,
int side1);
3803 void _fillSmoothQuarterCircleInterHP2(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg1,
int side1,
const BSeg& seg2,
int side2);
3804 void _fillSmoothCircleInterHP(
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg,
int side);
3806 void _drawSmoothQuarterCircleInterHPsub(
tgx::fVec2 C,
float R,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color,
float opacity,
int nb_planes, int32_t kx1 = 0, int32_t ky1 = 0, int32_t off1 = 0, int32_t off1_full = 0, int32_t kx2 = 0, int32_t ky2 = 0, int32_t off2 = 0, int32_t off2_full = 0);
3807 void _drawSmoothQuarterCircleInterHP0(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity);
3808 void _drawSmoothQuarterCircleInterHP1(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg1,
int side1);
3809 void _drawSmoothQuarterCircleInterHP2(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg1,
int side1,
const BSeg& seg2,
int side2);
3811 void _drawSmoothThickQuarterCircleInterHPsub(
tgx::fVec2 C,
float R,
float thickness,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color,
float opacity,
int nb_planes, int32_t kx1 = 0, int32_t ky1 = 0, int32_t off1 = 0, int32_t off1_full = 0, int32_t kx2 = 0, int32_t ky2 = 0, int32_t off2 = 0, int32_t off2_full = 0);
3812 void _drawSmoothThickQuarterCircleInterHP0(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color,
float opacity);
3813 void _drawSmoothThickQuarterCircleInterHP1(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color,
float opacity,
const BSeg& seg1,
int side1);
3814 void _drawSmoothThickQuarterCircleInterHP2(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color,
float opacity,
const BSeg& seg1,
int side1,
const BSeg& seg2,
int side2);
3816 void _fillSmoothThickQuarterCircleInterHPsub(
tgx::fVec2 C,
float R,
float thickness,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color_interior, color_t color_border,
float opacity,
int nb_planes, int32_t kx1 = 0, int32_t ky1 = 0, int32_t off1 = 0, int32_t off1_full = 0, int32_t kx2 = 0, int32_t ky2 = 0, int32_t off2 = 0, int32_t off2_full = 0);
3817 void _fillSmoothThickQuarterCircleInterHP0(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color_interior, color_t color_border,
float opacity);
3818 void _fillSmoothThickQuarterCircleInterHP1(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color_interior, color_t color_border,
float opacity,
const BSeg& seg1,
int side1);
3819 void _fillSmoothThickQuarterCircleInterHP2(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color_interior, color_t color_border,
float opacity,
const BSeg& seg1,
int side1,
const BSeg& seg2,
int side2);
3829 template<
bool OUTLINE,
bool FILL,
bool CHECKRANGE>
void _drawEllipse(
int x0,
int y0,
int rx,
int ry, color_t outline_color, color_t interior_color,
float opacity);
3832 void _drawSmoothQuarterEllipse(
tgx::fVec2 C,
float rx,
float ry,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color,
float opacity);
3833 void _drawSmoothThickQuarterEllipse(
tgx::fVec2 C,
float rx,
float ry,
float thickness,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color,
float opacity);
3834 void _fillSmoothQuarterEllipse(
tgx::fVec2 C,
float rx,
float ry,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color,
float opacity);
3835 void _fillSmoothThickQuarterEllipse(
tgx::fVec2 C,
float rx,
float ry,
float thickness,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color_interior, color_t color_border,
float opacity);
3845 void _plotQuadRationalBezierSeg(
const bool checkrange,
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
float w,
const color_t color,
const float opacity);
3846 void _plotQuadRationalBezier(
const bool checkrange,
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
float w,
const bool draw_P2,
const color_t color,
const float opacity);
3847 void _drawQuadBezier(iVec2 P1, iVec2 P2, iVec2 PC,
float wc,
bool drawP2, color_t color,
float opacity);
3849 void _plotCubicBezierSeg(
const bool checkrange,
int x0,
int y0,
float x1,
float y1,
float x2,
float y2,
int x3,
int y3,
const color_t color,
const float opacity);
3850 void _plotCubicBezier(
const bool checkrange,
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
bool draw_P2,
const color_t color,
const float opacity);
3851 void _drawCubicBezier(iVec2 P1, iVec2 P2, iVec2 PA, iVec2 PB,
bool drawP2, color_t color,
float opacity);
3853 void _plotQuadSpline(
int n,
int x[],
int y[],
bool draw_last,
const color_t color,
const float opacity);
3854 template<
int SPLINE_MAX_POINTS>
void _drawQuadSpline(
int nbpoints,
const iVec2* tabPoints,
bool draw_last_point, color_t color,
float opacity);
3856 void _plotClosedSpline(
int n,
int x[],
int y[],
const color_t color,
const float opacity);
3857 template<
int SPLINE_MAX_POINTS>
void _drawClosedSpline(
int nbpoints,
const iVec2* tabPoints, color_t color,
float opacity);
3859 void _plotCubicSpline(
int n,
int x[],
int y[],
bool draw_last,
const color_t color,
const float opacity);
3860 template<
int SPLINE_MAX_POINTS>
void _drawCubicSpline(
int nbpoints,
const iVec2* tabPoints,
bool draw_last_point, color_t color,
float opacity);
3865 static bool _splitRationalQuadBezier(fVec2 P1, fVec2 P2, fVec2 PC,
float w, fVec2& Q, fVec2& PB,
float& wb);
3866 static bool _splitCubicBezier(fVec2 P1, fVec2 P2, fVec2 PPC1, fVec2 PPC2, fVec2& Q, fVec2& C, fVec2 & D);
3874 bool _clipit(
int& x,
int& y,
int& sx,
int& sy,
int& b_left,
int& b_up);
3876 template<
bool BLEND>
iVec2 _drawCharGFX(
char c, iVec2 pos, color_t col,
const GFXfont& font,
float opacity);
3877 template<
bool BLEND>
iVec2 _drawCharILI(
char c, iVec2 pos, color_t col,
const ILI9341_t3_font_t& font,
float opacity);
3879 template<
bool BLEND>
iVec2 _drawTextGFX(
const char* text, iVec2 pos,
const GFXfont& font, color_t col,
float opacity,
bool wrap,
bool start_newline_at_0);
3880 template<
bool BLEND>
iVec2 _drawTextILI(
const char* text, iVec2 pos,
const ILI9341_t3_font_t& font, color_t col,
float opacity,
bool wrap,
bool start_newline_at_0);
3882 template<
bool BLEND>
void _drawCharILI9341_t3(
const uint8_t* bitmap, int32_t off,
int rsx,
int b_up,
int b_left,
int sx,
int sy,
int x,
int y, color_t col,
float opacity);
3883 template<
bool BLEND>
static void _drawcharline(
const uint8_t* bitmap, int32_t off, color_t* p,
int dx, color_t col,
float opacity);
3884 template<
bool BLEND>
void _drawCharBitmap_1BPP(
const uint8_t* bitmap,
int rsx,
int b_up,
int b_left,
int sx,
int sy,
int x,
int y, color_t col,
float opacity);
3885 template<
bool BLEND>
void _drawCharBitmap_2BPP(
const uint8_t* bitmap,
int rsx,
int b_up,
int b_left,
int sx,
int sy,
int x,
int y, color_t col,
float opacity);
3886 template<
bool BLEND>
void _drawCharBitmap_4BPP(
const uint8_t* bitmap,
int rsx,
int b_up,
int b_left,
int sx,
int sy,
int x,
int y, color_t col,
float opacity);
3887 template<
bool BLEND>
void _drawCharBitmap_8BPP(
const uint8_t* bitmap,
int rsx,
int b_up,
int b_left,
int sx,
int sy,
int x,
int y, color_t col,
float opacity);
3889 template<
bool BLEND>
static TGX_INLINE
inline void _drawFontPixel(color_t* p, color_t col, uint32_t alpha256)
3893 p->blend256(col, alpha256);
3895 else if (alpha256 >= 256)
3899 else if (alpha256 > 0)
3901 p->blend256(col, alpha256);
Anchor
Define the placement of an anchor point inside a box.
Definition: Box2.h:74
Color classes [RGB565, RGB24, RGB32, RGB64, RGBf, HSV].
Define the GFXFont anf ILI9341_t3 font format if needed.
EndPath
Enumeration of end path shapes.
Definition: Image.h:51
@ END_ARROW_SKEWED_1
tiny skewed arrow head [extends = line thickness]
Definition: Image.h:59
@ END_ARROW_SKEWED_4
large skewed arrow head [extends = 4 x line thickness]
Definition: Image.h:62
@ END_ARROW_3
medium arrow head [extends = 3 x line thickness]
Definition: Image.h:56
@ END_ROUNDED
rounded end.
Definition: Image.h:53
@ END_ARROW_5
huge arrow head [extends = 5 x line thickness]
Definition: Image.h:58
@ END_ARROW_SKEWED_3
medium skewed arrow head [extends = 3 x line thickness]
Definition: Image.h:61
@ END_STRAIGHT
straight end.
Definition: Image.h:52
@ END_ARROW_SKEWED_2
small skewed arrow head [extends = 2 x line thickness]
Definition: Image.h:60
@ END_ARROW_1
tiny arrow head [extends = line thickness]
Definition: Image.h:54
@ END_ARROW_SKEWED_5
huge skewed arrow head [extends = 5 x line thickness]
Definition: Image.h:63
@ END_ARROW_4
large arrow head [extends = 4 x line thickness]
Definition: Image.h:57
@ END_ARROW_2
small arrow head [extends = 2 x line thickness]
Definition: Image.h:55
Utility/miscellaneous functions used throughout the library.
TGX_INLINE T min(const T &a, const T &b)
Don't know why but faster than fminf() for floats.
Definition: Misc.h:132
TGX_INLINE T max(const T &a, const T &b)
Don't know why but much faster than fmaxf() for floats.
Definition: Misc.h:136
3D triangle rasterizer function.
Triangle shader parameters.
Triangle shader functions.
Vec2< int > iVec2
Integer-valued 2D vector.
Definition: Vec2.h:47
Image class [MAIN CLASS FOR THE 2D API].
Definition: Image.h:145
void drawLineAA(fVec2 P1, fVec2 P2, color_t color, float opacity=1.0f)
Draw a line segment between two points [High quality].
void iterate(ITERFUN cb_fun, tgx::iBox2 B) const
Iterate over the pixel of the image inside a given region.
iVec2 drawText(const char *text, iVec2 pos, const GFXfont &font, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a text at a given position with a given font.
TGX_INLINE int height() const
Return the image height.
Definition: Image.h:372
void drawPolygonAA(int nbpoints, const fVec2 tabPoints[], color_t color, float opacity=1.0f)
Draw a closed polygon with vertices [P0,P2,,, PN] (High quality).
void drawTexturedTriangle(const Image< color_t_tex > &src_im, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, const BLEND_OPERATOR &blend_op)
Blend a textured triangle onto the image.
void fillThickRectAA(const fBox2 &B, float thickness, color_t color_interior, color_t color_border, float opacity=1.0f)
Draw a filled rectangle with a thick border of a different color [High quality].
TGX_INLINE int stride() const
Return the image stride.
Definition: Image.h:388
int PNGDecode(PNG_T &png, iVec2 topleft=iVec2(0, 0), float opacity=1.0f)
Decode a PNG image into this image using the PNGDec library: https://github.com/bitbank2/PNGdec/.
iVec2 drawText(const char *text, iVec2 pos, const ILI9341_t3_font_t &font, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a text at a given position with a given font.
void drawThickPolygonAA(FUNCTOR_NEXT next_point, float thickness, color_t color, float opacity=1.0f)
Draw a polygon with thick lines (High quality).
TGX_INLINE const color_t & operator()(iVec2 pos) const
Get a reference to a pixel (no range check!)
Definition: Image.h:537
void set(T *buffer, int lx, int ly, int stride=DEFAULT_STRIDE)
Set/update the image parameters.
void drawRect(const iBox2 &B, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a rectangle.
TGX_INLINE const color_t * data() const
Return a pointer to the pixel buffer.
Definition: Image.h:414
void drawThickClosedSplineAA(int nbpoints, const fVec2 tabPoints[], float thickness, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a thick closed quadratic spline interpolating between a given set of points (high quality).
void iterate(ITERFUN cb_fun)
Iterate over all the pixels of the image.
void drawCircle(iVec2 center, int r, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a circle.
int fill(iVec2 start_pos, color_t new_color)
'Flood fill' a 4-connected region of the image.
void fillThickEllipseAA(fVec2 center, fVec2 radiuses, float thickness, color_t color_interior, color_t color_border, float opacity=1.0f)
Draw a filled ellipse with a thick border of a different color (high quality).
Image(const Image< color_t > &im)=default
Default copy constructor.
void fillRectAA(const fBox2 &B, color_t color, float opacity=1.0f)
Draw a filled rectangle [High quality].
TGX_INLINE color_t readPixel(iVec2 pos, color_t outside_color=color_t()) const
Return the color of a pixel at a given position.
Definition: Image.h:510
void fillCircleSectorAA(fVec2 center, float r, float angle_start, float angle_end, color_t color, float opacity=1.0f)
Draw a filled circle sector/slice/pie (high quality).
void drawThickRect(const iBox2 &B, int thickness, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a rectangle with a thick outline.
void drawFastVLine(iVec2 pos, int h, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a vertical segment of h pixels starting at pos.
void drawPolyline(FUNCTOR_NEXT next_point, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a polyline ie a sequence of consecutive segments [P0,P1] , [P1,P2],,, [Pn-1,Pn].
void drawThickRectAA(const fBox2 &B, float thickness, color_t color, float opacity=1.0f)
Draw a filled rectangle with a thick border [High quality].
void crop(const iBox2 &subbox)
Crop the image.
Image(T *buffer, iVec2 dim, int stride=DEFAULT_STRIDE)
Constructor.
void copyFrom(const Image< src_color_t > &src_im, const BLEND_OPERATOR &blend_op)
Blend the src image onto the destination image with resizing and color conversion.
void drawFastHLine(iVec2 pos, int w, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a horizontal segment of w pixels starting at pos.
Image(T *buffer, int lx, int ly, int stride=DEFAULT_STRIDE)
Constructor.
void iterate(ITERFUN cb_fun) const
Iterate over all the pixels of the image.
void fillThickPolygonAA(FUNCTOR_NEXT next_point, float thickness, color_t interior_color, color_t border_color, float opacity=1.0f)
Draw a filled polygon with a thick border of a different color (High quality).
void drawClosedSpline(int nbpoints, const iVec2 tabPoints[], color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a closed quadratic spline interpolating between a given set of points.
void fillRoundRectAA(const fBox2 &B, float corner_radius, color_t color, float opacity=1.0f)
Draw a filled rounded rectangle [High quality].
void drawThickCubicBezierAA(fVec2 P1, fVec2 P2, fVec2 PA, fVec2 PB, float thickness, EndPath end_P1, EndPath end_P2, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a thick cubic Bezier curve (high quality).
void drawEllipse(iVec2 center, iVec2 radiuses, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw an ellipse.
void setInvalid()
Set the image as invalid.
TGX_INLINE color_t & operator()(int x, int y)
Get a reference to a pixel (no range check!)
Definition: Image.h:574
void drawTexturedGradientMaskedTriangle(const Image< color_t_tex > &src_im, color_t_tex transparent_color, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, color_t_tex C1, color_t_tex C2, color_t_tex C3, float opacity=1.0f)
Blend textured triangle with a transparency mask (ie a specific color is treated as fully transparent...
void fillRectHGradient(iBox2 B, color_t color_left, color_t color_right, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a rectangle filled with a horizontal gradient of colors.
void setOpenFontRender(T &ofr, float opacity=TGX_DEFAULT_NO_BLENDING)
Link the image with Takkoa's OpenFontRender library : https://github.com/takkaO/OpenFontRender.
Definition: Image.h:3438
void fillThickCircleSectorAA(fVec2 center, float r, float angle_start, float angle_end, float thickness, color_t color_interior, color_t color_border, float opacity=1.0f)
Draw a filled circle sector/slice/pie with a thick border of a different color (high quality).
void drawTexturedGradientMaskedQuad(const Image< color_t_tex > &src_im, color_t_tex transparent_color, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 srcP4, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, fVec2 dstP4, color_t_tex C1, color_t_tex C2, color_t_tex C3, color_t_tex C4, float opacity=1.0f)
Draw a textured quad using bilinear filtering and with a mask (ie a fixed transparent color) and comb...
void drawTexturedGradientTriangle(const Image< color_t_tex > &src_im, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, color_t_tex C1, color_t_tex C2, color_t_tex C3, float opacity=TGX_DEFAULT_NO_BLENDING)
Blend textured triangle on the image while combining it with a color gradient.
void drawThickCircleArcAA(fVec2 center, float r, float angle_start, float angle_end, float thickness, color_t color, float opacity=1.0f)
Draw a circle arc with a thick border (high quality).
void drawTexturedGradientQuad(const Image< color_t_tex > &src_im, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 srcP4, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, fVec2 dstP4, color_t_tex C1, color_t_tex C2, color_t_tex C3, color_t_tex C4, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a textured quad using bilinear filtering combined with a color gradient.
void drawTexturedQuad(const Image< color_t_tex > &src_im, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 srcP4, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, fVec2 dstP4, const BLEND_OPERATOR &blend_op)
Draw a textured quad with bilinear filtering and a custom blending operator.
TGX_INLINE void drawPixelf(fVec2 pos, color_t color, float opacity)
Blend a pixel with the current pixel color (floating point coord).
Definition: Image.h:497
TGX_INLINE color_t & operator()(iVec2 pos)
Get a reference to a pixel (no range check!)
Definition: Image.h:548
Image()
Default constructor.
void drawLine(iVec2 P1, iVec2 P2, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a line segment between two points (uses Bresenham's algorithm).
void drawRoundRectAA(const fBox2 &B, float corner_radius, color_t color, float opacity=1.0f)
Draw a rounded rectangle [High quality].
TGX_INLINE int width() const
Return the image width.
Definition: Image.h:356
Image< color_t > operator()(const iBox2 &B) const
Return a sub-image of this image (sharing the same pixel buffer).
Image< color_t > getCrop(const iBox2 &subbox) const
Return a sub-image of this image (sharing the same pixel buffer).
void blitMasked(const Image< color_t > &sprite, color_t transparent_color, iVec2 upperleftpos, float opacity=1.0f)
Blend a sprite at a given position on this image with a given mask.
void fillQuad(iVec2 P1, iVec2 P2, iVec2 P3, iVec2 P4, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
draw a filled quad.
iVec2 drawTextEx(const char *text, iVec2 pos, const GFXfont &font, Anchor anchor, bool wrap_text, bool start_newline_at_0, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Advanced drawText method.
void fillRectVGradient(iBox2 B, color_t color_top, color_t color_bottom, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a rectangle filled with a vertical gradient of colors.
void drawPolylineAA(int nbpoints, const fVec2 tabPoints[], color_t color, float opacity=1.0f)
Draw a polyline ie a sequence of consecutive segments [P0,P1] , [P1,P2],,, [Pn-1,Pn] (High quality).
void drawTexturedMaskedTriangle(const Image< color_t_tex > &src_im, color_t_tex transparent_color, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, float opacity=1.0f)
Blend textured triangle with a transparency mask (ie a specific color is treated as fully transparent...
void drawQuad(iVec2 P1, iVec2 P2, iVec2 P3, iVec2 P4, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a quad.
TGX_INLINE void drawPixel(iVec2 pos, color_t color, float opacity)
Blend a pixel with the current pixel color.
Definition: Image.h:481
void blitRotated(const Image< color_t_src > &sprite, iVec2 upperleftpos, int angle, const BLEND_OPERATOR &blend_op)
Blend a rotated sprite over this image at a given position using a custom blending operator.
TGX_INLINE bool isValid() const
Query if the image is valid.
Definition: Image.h:340
void blit(const Image< color_t > &sprite, iVec2 upperleftpos, float opacity=TGX_DEFAULT_NO_BLENDING)
Blit/blend a sprite over this image at a given position.
void fillRoundRect(const iBox2 &B, int corner_radius, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a filled rounded rectangle in box B with radius corner_radius.
void fillPolygon(int nbpoints, const iVec2 tabPoints[], color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a filled polygon with vertices [P0,P2,,, PN].
void drawPolygon(FUNCTOR_NEXT next_point, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a closed polygon with vertices [P0,P2,,, PN].
void fillScreenVGradient(color_t top_color, color_t bottom_color)
Fill the whole image with a vertical color gradient between two colors.
iBox2 measureText(const char *text, iVec2 pos, const ILI9341_t3_font_t &font, Anchor anchor=DEFAULT_TEXT_ANCHOR, bool wrap_text=false, bool start_newline_at_0=false) const
Compute the bounding box of a text.
void drawThickLineAA(fVec2 P1, fVec2 P2, float line_width, EndPath end_P1, EndPath end_P2, color_t color, float opacity=1.0f)
Draw a thick line segment between two points [High quality].
TGX_INLINE const color_t & operator()(int x, int y) const
Get a reference to a pixel (no range check!)
Definition: Image.h:561
void fillEllipse(iVec2 center, iVec2 radiuses, color_t interior_color, color_t outline_color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a filled ellipse with different colors for the outline and the interior.
TGX_INLINE void drawPixel(iVec2 pos, color_t color)
Set a pixel at a given position.
Definition: Image.h:455
TGX_INLINE iVec2 dim() const
Return the image dimensions as an iVec2.
Definition: Image.h:396
int fontHeight(const GFXfont &font) const
Query the height of a font.
void clear(color_t color)
Fill the whole image with a single color.
void fillThickRect(const iBox2 &B, int thickness, color_t color_interior, color_t color_border, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a filled rectangle with a thick border of a possibly different color.
void drawThickRoundRectAA(const fBox2 &B, float corner_radius, float thickness, color_t color, float opacity=1.0f)
Draw a rounded rectangle with a thick border [High quality].
void drawThickQuadAA(fVec2 P1, fVec2 P2, fVec2 P3, fVec2 P4, float thickness, color_t color, float opacity=1.0f)
Draw a quad with a thick border [High quality].
TGX_INLINE color_t * data()
Return a pointer to the pixel buffer.
Definition: Image.h:424
void drawPolygonAA(FUNCTOR_NEXT next_point, color_t color, float opacity=1.0f)
Draw a closed polygon with vertices [P0,P2,,, PN] (High quality).
void drawGradientQuad(fVec2 P1, fVec2 P2, fVec2 P3, fVec2 P4, color_alt colorP1, color_alt colorP2, color_alt colorP3, color_alt colorP4, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a quad with a gradient color specified by the color at the four vertices.
void fillCircle(iVec2 center, int r, color_t interior_color, color_t outline_color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a filled circle with different colors for outline and interior.
TGX_INLINE iBox2 imageBox() const
Return the image dimension as a box.
Definition: Image.h:404
void drawPolylineAA(FUNCTOR_NEXT next_point, color_t color, float opacity=1.0f)
Draw a polyline ie a sequence of consecutive segments [P0,P1] , [P1,P2],,, [Pn-1,Pn] (High quality).
void fillRect(const iBox2 &B, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a filled rectangle.
void set(T *buffer, iVec2 dim, int stride=DEFAULT_STRIDE)
Set/update the image parameters.
void blitScaledRotated(const Image< color_t_src > &src_im, fVec2 anchor_src, fVec2 anchor_dst, float scale=1.0f, float angle_degrees=0.0f, float opacity=TGX_DEFAULT_NO_BLENDING)
Blit/blend a sprite onto this image after rescaling and rotation.
void drawRoundRect(const iBox2 &B, int corner_radius, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a rounded rectangle in box B with radius corner_radius.
void drawThickCircleAA(fVec2 center, float r, float thickness, color_t color, float opacity=1.0f)
Draw a circle with a thick border (high quality).
void drawPolyline(int nbpoints, const iVec2 tabPoints[], color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a polyline ie a sequence of consecutive segments [P0,P1] , [P1,P2],,, [Pn-1,Pn].
void drawThickQuadSplineAA(int nbpoints, const fVec2 tabPoints[], float thickness, EndPath end_P0, EndPath end_Pn, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a thick quadratic spline interpolating between a given set of points (high quality).
void fillScreenHGradient(color_t left_color, color_t right_color)
Fill the whole screen with a horizontal color gradient between two colors.
Image< color_dst > convert()
Convert this image to another type.
void drawCircleArcAA(fVec2 center, float r, float angle_start, float angle_end, color_t color, float opacity=1.0f)
Draw a circle arc (high quality).
TGX_INLINE int lx() const
Return the image width.
Definition: Image.h:364
void drawTriangleAA(fVec2 P1, fVec2 P2, fVec2 P3, color_t color, float opacity=1.0f)
Draw a triangle [High quality].
TGX_INLINE int ly() const
Return the image height.
Definition: Image.h:380
int fill(iVec2 start_pos, color_t border_color, color_t new_color)
'Flood fill' a 4-connected region of the image.
iBox2 measureChar(char c, iVec2 pos, const GFXfont &font, Anchor anchor=DEFAULT_TEXT_ANCHOR, int *xadvance=nullptr) const
Compute the bounding box of a character.
void copyFrom(const Image< src_color_t > &src_im, float opacity=TGX_DEFAULT_NO_BLENDING)
Copy (or blend) the src image onto the destination image with resizing and color conversion.
iVec2 drawTextEx(const char *text, iVec2 pos, const ILI9341_t3_font_t &font, Anchor anchor, bool wrap_text, bool start_newline_at_0, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Advanced drawText method.
void drawThickPolylineAA(FUNCTOR_NEXT next_point, float thickness, EndPath end_P0, EndPath end_Pn, color_t color, float opacity=1.0f)
Draw a thick polyline ie a sequence of consecutive thick segments [P0,P1] , [P1,P2],...
void blit(const Image< color_t_src > &sprite, iVec2 upperleftpos, const BLEND_OPERATOR &blend_op)
Blend a sprite at a given position on the image using a custom blending operator.
void drawTexturedMaskedQuad(const Image< color_t_tex > &src_im, color_t_tex transparent_color, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 srcP4, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, fVec2 dstP4, float opacity=1.0f)
Draw a textured quad using bilinear filtering and with a mask (ie a fixed transparent color).
void drawThickPolygonAA(int nbpoints, const fVec2 tabPoints[], float thickness, color_t color, float opacity=1.0f)
Draw a polygon with thick lines (High quality).
void fillScreen(color_t color)
Fill the whole image with a single color.
Image< color_t > copyReduceHalf(const Image< color_t > &src_image)
Copy the source image pixels into this image, reducing it by half in the process.
void blitBackward(Image< color_t > &dst_sprite, iVec2 upperleftpos) const
Reverse blitting.
void drawWedgeLineAA(fVec2 P1, fVec2 P2, float line_width_P1, EndPath end_P1, float line_width_P2, EndPath end_P2, color_t color, float opacity=1.0f)
Draw a from P1 to P2 with with respective wideness line_width_P1 and line_width_P2 at both ends [High...
void fillThickQuadAA(fVec2 P1, fVec2 P2, fVec2 P3, fVec2 P4, float thickness, color_t color_interior, color_t color_border, float opacity=1.0f)
Draw a filled quad with a thick border of a different color [High quality].
void drawTexturedQuad(const Image< color_t_tex > &src_im, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 srcP4, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, fVec2 dstP4, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a textured quad using bilinear filtering.
void fillPolygon(FUNCTOR_NEXT next_point, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a filled polygon with vertices [P0,P2,,, PN].
void blitScaledRotatedMasked(const Image< color_t_src > &src_im, color_t_src transparent_color, fVec2 anchor_src, fVec2 anchor_dst, float scale, float angle_degrees, float opacity=1.0f)
Blend a sprite onto this image after rescaling and rotation and use a given color which is treated as...
void drawEllipseAA(fVec2 center, fVec2 radiuses, color_t color, float opacity=1.0f)
Draw an ellipse (high quality).
Image(const Image< color_t > &im, iBox2 subbox)
Constructor.
void fillThickClosedSplineAA(int nbpoints, const fVec2 tabPoints[], float thickness, color_t color_interior, color_t color_border, float opacity=TGX_DEFAULT_NO_BLENDING)
Fill a region delimited by a closed thick quadratic spline where the interior and boundary can have d...
void fillQuadAA(fVec2 P1, fVec2 P2, fVec2 P3, fVec2 P4, color_t color, float opacity=1.0f)
Draw a filled quad [High quality].
void drawThickQuadBezierAA(fVec2 P1, fVec2 P2, fVec2 PC, float wc, float thickness, EndPath end_P1, EndPath end_P2, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a thick quadratic (rational) Bezier curve (high quality).
iBox2 measureText(const char *text, iVec2 pos, const GFXfont &font, Anchor anchor=DEFAULT_TEXT_ANCHOR, bool wrap_text=false, bool start_newline_at_0=false) const
Compute the bounding box of a text.
void drawThickPolylineAA(int nbpoints, const fVec2 tabPoints[], float thickness, EndPath end_P0, EndPath end_Pn, color_t color, float opacity=1.0f)
Draw a thick polyline ie a sequence of consecutive thick segments [P0,P1] , [P1,P2],...
void blitScaledRotated(const Image< color_t_src > &src_im, fVec2 anchor_src, fVec2 anchor_dst, float scale, float angle_degrees, const BLEND_OPERATOR &blend_op)
Blend a sprite onto this image after rescaling and rotation using a custom blending operator.
void drawThickTriangleAA(fVec2 P1, fVec2 P2, fVec2 P3, float thickness, color_t color, float opacity=1.0f)
Draw a triangle with a thick border [High quality].
TGX_INLINE color_t readPixelf(fVec2 pos, color_t outside_color=color_t()) const
Return the color of a pixel at a given position (floating point coord).
Definition: Image.h:525
void fillPolygonAA(FUNCTOR_NEXT next_point, color_t color, float opacity=1.0f)
Draw a filled polygon (High quality).
Image< color_t > operator()(int min_x, int max_x, int min_y, int max_y) const
Return a sub-image of this image (sharing the same pixel buffer).
void drawCubicBezier(iVec2 P1, iVec2 P2, iVec2 PA, iVec2 PB, bool drawP2, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a cubic Bezier curve.
iBox2 measureChar(char c, iVec2 pos, const ILI9341_t3_font_t &font, Anchor anchor=DEFAULT_TEXT_ANCHOR, int *xadvance=nullptr) const
Compute the bounding box of a character.
void drawThickCubicSplineAA(int nbpoints, const fVec2 tabPoints[], float thickness, EndPath end_P0, EndPath end_Pn, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a thick cubic spline interpolating between a given set of points (high quality).
void fillTriangleAA(fVec2 P1, fVec2 P2, fVec2 P3, color_t color, float opacity=1.0f)
Draw a filled triangle [High quality].
void fillEllipseAA(fVec2 center, fVec2 radiuses, color_t color, float opacity=1.0f)
Draw a filled ellipse (high quality).
void drawTriangle(const iVec2 &P1, const iVec2 &P2, const iVec2 &P3, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a triangle.
void drawPolygon(int nbpoints, const iVec2 tabPoints[], color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a closed polygon with vertices [P0,P2,,, PN].
void fillThickTriangleAA(fVec2 P1, fVec2 P2, fVec2 P3, float thickness, color_t color_interior, color_t color_border, float opacity=1.0f)
Draw a filled triangle with a thick border of a different color [High quality].
void drawGradientTriangle(fVec2 P1, fVec2 P2, fVec2 P3, color_alt colorP1, color_alt colorP2, color_alt colorP3, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a triangle with gradient color specified by the colors on its vertices.
iVec2 drawChar(char c, iVec2 pos, const GFXfont &font, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a single character at position pos on the image and return the position for the next character.
void drawCubicSpline(int nbpoints, const iVec2 tabPoints[], bool draw_last_point, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a cubic spline interpolating between a given set of points.
void fillThickCircleAA(fVec2 center, float r, float thickness, color_t color_interior, color_t color_border, float opacity=1.0f)
Draw a filled circle with a thick border of a different color (high quality).
void fillClosedSplineAA(int nbpoints, const fVec2 tabPoints[], color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Fill a region delimited by a closed quadratic spline (high quality).
void fillTriangle(const iVec2 &P1, const iVec2 &P2, const iVec2 &P3, color_t interior_color, color_t outline_color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a filled triangle with different colors for the outline and the interior.
void drawQuadBezier(iVec2 P1, iVec2 P2, iVec2 PC, float wc, bool drawP2, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a quadratic (rational) Bezier curve.
void fillCircleAA(fVec2 center, float r, color_t color, float opacity=1.0f)
Draw a filled circle (high quality).
void drawQuadAA(fVec2 P1, fVec2 P2, fVec2 P3, fVec2 P4, color_t color, float opacity=1.0f)
Draw a quad [High quality].
void fillThickRoundRectAA(const fBox2 &B, float corner_radius, float thickness, color_t color_interior, color_t color_border, float opacity=1.0f)
Draw a filled rounded rectangle with a thick border of another color [High quality].
void blitRotated(const Image< color_t > &sprite, iVec2 upperleftpos, int angle, float opacity=TGX_DEFAULT_NO_BLENDING)
Blit/blend a rotated sprite over this image at a given position.
void drawCircleAA(fVec2 center, float r, color_t color, float opacity=1.0f)
Draw a circle (high quality).
int JPEGDecode(JPEG_T &jpeg, iVec2 topleft=iVec2(0, 0), int options=0, float opacity=1.0f)
Decode a JPEG image into this image using the JPEGDEC library: https://github.com/bitbank2/JPEGDEC/.
void drawSegment(iVec2 P1, bool drawP1, iVec2 P2, bool drawP2, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a line segment between two points (using Bresenham's algorithm).
void fillPolygonAA(int nbpoints, const fVec2 tabPoints[], color_t color, float opacity=1.0f)
Draw a filled polygon (High quality).
Image< color_t > reduceHalf()
Reduce this image by half.
Image & operator=(const Image< color_t > &im)=default
Default assignment operator.
TGX_INLINE void drawPixelf(fVec2 pos, color_t color)
Set a pixel at a given position (floating point coord).
Definition: Image.h:467
void drawQuadSpline(int nbpoints, const iVec2 tabPoints[], bool draw_last_point, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a quadratic spline interpolating between a given set of points.
void iterate(ITERFUN cb_fun, tgx::iBox2 B)
Iterate over the pixel of the image inside a given region.
void fillThickPolygonAA(int nbpoints, const fVec2 tabPoints[], float thickness, color_t interior_color, color_t border_color, float opacity=1.0f)
Draw a filled polygon with a thick border of a different color (High quality).
static const int DEFAULT_STRIDE
If not specified, the stride of an image is equal to its width.
Definition: Image.h:156
void drawTexturedTriangle(const Image< color_t_tex > &src_im, fVec2 srcP1, fVec2 srcP2, fVec2 srcP3, fVec2 dstP1, fVec2 dstP2, fVec2 dstP3, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw textured triangle onto the image.
int GIFplayFrame(GIF_T &gif, iVec2 topleft=iVec2(0, 0), float opacity=1.0f)
Decode a (possibly animated) GIF image into this image using the AnimatedGIF library: https://github....
void drawThickEllipseAA(fVec2 center, fVec2 radiuses, float thickness, color_t color, float opacity=1.0f)
Draw an ellipse with a thick border (high quality).
iVec2 drawChar(char c, iVec2 pos, const ILI9341_t3_font_t &font, color_t color, float opacity=TGX_DEFAULT_NO_BLENDING)
Draw a single character at position pos on the image and return the position for the next character.
int fontHeight(const ILI9341_t3_font_t &font) const
Query the height of a font.
GFXFont font format.
Definition: Fonts.h:74
ILI9341_t3 PJRC font format.
Definition: Fonts.h:105
Generic 2D Box [specializations iBox2 , fBox2, dBox2].
Definition: Box2.h:151
Color in R5/G6/B5 format.
Definition: Color.h:216
Generic 2D vector [specializations iVec2, fVec2, dVec2].
Definition: Vec2.h:64
T x
'x' coordinate (first dimension)
Definition: Vec2.h:72
T y
'y' coordinate (second dimension)
Definition: Vec2.h:73
#define TGX_DEFAULT_NO_BLENDING
Default opacity sentinel used by drawing primitives to request overwrite/no-blending mode.
Definition: tgx_config.h:242