141 template<
typename color_t>
146 static_assert(is_color<color_t>::value,
"color_t must be one of the color types defined in Color.h");
149 template<
typename>
friend class Image;
157 #if (MTOOLS_TGX_EXTENSIONS)
158 #include <mtools/extensions/tgx/tgx_ext_Image.inl>
338 inline TGX_INLINE
bool isValid()
const {
return (_buffer !=
nullptr); }
354 inline TGX_INLINE
int width()
const {
return _lx; }
362 inline TGX_INLINE
int lx()
const {
return _lx; }
370 inline TGX_INLINE
int height()
const {
return _ly; }
378 inline TGX_INLINE
int ly()
const {
return _ly; }
386 inline TGX_INLINE
int stride()
const {
return _stride; }
412 inline TGX_INLINE
const color_t *
data()
const {
return _buffer; }
422 inline TGX_INLINE color_t *
data() {
return _buffer; }
453 template<
bool CHECKRANGE = true> TGX_INLINE
inline void drawPixel(
iVec2 pos, color_t color) {
if ((CHECKRANGE) && (!
isValid()))
return; _drawPixel<CHECKRANGE>(pos, color); }
465 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); }
479 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); }
495 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); }
508 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); }
523 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); }
535 TGX_INLINE
inline const color_t&
operator()(
iVec2 pos)
const {
return _buffer[TGX_CAST32(pos.
x) + TGX_CAST32(_stride) * TGX_CAST32(pos.
y)]; }
546 TGX_INLINE
inline color_t&
operator()(
iVec2 pos) {
return _buffer[TGX_CAST32(pos.
x) + TGX_CAST32(_stride) * TGX_CAST32(pos.
y)]; }
559 TGX_INLINE
inline const color_t&
operator()(
int x,
int y)
const {
return _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)]; }
572 TGX_INLINE
inline color_t&
operator()(
int x,
int y) {
return _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)];}
600 template<
typename ITERFUN>
void iterate(ITERFUN cb_fun);
617 template<
typename ITERFUN>
void iterate(ITERFUN cb_fun)
const;
707 template<
typename color_t_src,
typename BLEND_OPERATOR>
752 template<
typename color_t_src,
typename BLEND_OPERATOR>
816 template<
typename color_t_src,
int CACHE_SIZE = TGX_PROGMEM_DEFAULT_CACHE_SIZE>
844 template<
typename color_t_src,
typename BLEND_OPERATOR,
int CACHE_SIZE = TGX_PROGMEM_DEFAULT_CACHE_SIZE>
879 template<
typename color_t_src,
int CACHE_SIZE = TGX_PROGMEM_DEFAULT_CACHE_SIZE>
974 template<
typename color_dst>
1053 template<
int STACK_SIZE = 1024>
int fill(
iVec2 start_pos, color_t new_color);
1078 template<
int STACK_SIZE = 1024>
int fill(
iVec2 start_pos, color_t border_color, color_t new_color);
1210#ifndef DOXYGEN_EXCLUDE
1228 DEPRECATED(
"Use method drawThickLineAA() instead.")
1229 void drawWideLine(
fVec2 PA,
fVec2 PB,
float w, color_t color,
float opacity) {
drawThickLineAA(PA, PB, w, END_ROUNDED, END_ROUNDED, color, opacity); }
1237 DEPRECATED(
"Use method drawWedgeLineAA() instead.")
1238 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); }
1246 DEPRECATED(
"Use method fillCircleAA() instead")
1247 void drawSpot(fVec2 center,
float r, color_t color,
float opacity) {
fillCircleAA(center, r, color, opacity); }
1413 void fillThickRectAA(
const fBox2& B,
float thickness, color_t color_interior, color_t color_border,
float opacity = 1.0f);
1524 void fillThickRoundRectAA(
const fBox2& B,
float corner_radius,
float thickness, color_t color_interior, color_t color_border,
float opacity = 1.0f);
1676 template<
typename color_alt>
1703 template<
typename color_t_tex>
1739 template<
typename color_t_tex,
typename BLEND_OPERATOR>
1769 template<
typename color_t_tex>
1770 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);
1794 template<
typename color_t_tex>
1825 template<
typename color_t_tex>
1826 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);
1981 template<
typename color_alt>
1990 template<
typename color_t_tex>
1999 template<
typename color_t_tex,
typename BLEND_OPERATOR>
2008 template<
typename color_t_tex>
2009 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);
2017 template<
typename color_t_tex>
2018 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);
2026 template<
typename color_t_tex>
2027 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);
2082 template<
typename FUNCTOR_NEXT>
2133 template<
typename FUNCTOR_NEXT>
2175 template<
typename FUNCTOR_NEXT>
2228 template<
typename FUNCTOR_NEXT>
2268 template<
typename FUNCTOR_NEXT>
2320 template<
typename FUNCTOR_NEXT>
2321 void drawPolygonAA(FUNCTOR_NEXT next_point, color_t color,
float opacity = 1.0f);
2361 template<
typename FUNCTOR_NEXT>
2403 template<
typename FUNCTOR_NEXT>
2404 void fillPolygonAA(FUNCTOR_NEXT next_point, color_t color,
float opacity = 1.0f);
2419 void fillThickPolygonAA(
int nbpoints,
const fVec2 tabPoints[],
float thickness, color_t interior_color, color_t border_color,
float opacity = 1.0f);
2447 template<
typename FUNCTOR_NEXT>
2448 void fillThickPolygonAA(FUNCTOR_NEXT next_point,
float thickness, color_t interior_color, color_t border_color,
float opacity = 1.0f);
2566 void fillThickCircleAA(
fVec2 center,
float r,
float thickness, color_t color_interior, color_t color_border,
float opacity = 1.0f);
2607 void drawCircleArcAA(
fVec2 center,
float r,
float angle_start,
float angle_end, color_t color,
float opacity = 1.0f);
2679 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);
2863 template<
int SPLINE_MAX_POINTS = 32>
2884 template<
int SPLINE_MAX_POINTS = 32>
2904 template<
int SPLINE_MAX_POINTS = 32>
2981 template<
int SPLINE_MAX_POINTS = 32>
3006 template<
int SPLINE_MAX_POINTS = 32>
3029 template<
int SPLINE_MAX_POINTS = 32>
3054 template<
int SPLINE_MAX_POINTS = 32>
3085 template<
int SPLINE_MAX_POINTS = 32>
3356#ifndef DOXYGEN_EXCLUDE
3374 DEPRECATED(
"Use new signature: drawText(text, pos, font, color, opacity) or the new method drawTextEx()")
3375 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, DEFAULT_TEXT_ANCHOR, font,
false, start_newline_at_0, color, opacity); }
3381 DEPRECATED(
"Use new signature: drawText(text, pos, font, color, opacity) or the new method drawTextEx()")
3382 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, DEFAULT_TEXT_ANCHOR, font,
false, start_newline_at_0, color, opacity); }
3388 DEPRECATED(
"Use new signature measureText(text,pos,font,anchor, wrap, newline_at_0)")
3389 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); }
3395 DEPRECATED(
"Use new signature measureText(text,pos,font,anchor, wrap, newline_at_0)")
3396 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); }
3432 if ((opacity >= 0) && (opacity < 1))
3434 ofr.set_drawPixel([&](int32_t x, int32_t y, uint16_t c) {
drawPixel({ x,y }, color_t(
RGB565(c)), opacity);
return; });
3435 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; });
3439 ofr.set_drawPixel([&](int32_t x, int32_t y, uint16_t c) {
drawPixel({ x,y }, color_t(
RGB565(c)));
return; });
3440 ofr.set_drawFastHLine([&](int32_t x, int32_t y, int32_t w, uint16_t c) {
drawFastHLine({ x,y }, w, color_t(
RGB565(c)));
return; });
3442 ofr.set_startWrite([&](
void) {
return; });
3443 ofr.set_endWrite([&](
void) {
return; });
3498 template<
typename JPEG_T>
int JPEGDecode(JPEG_T& jpeg,
iVec2 topleft =
iVec2(0, 0),
int options = 0,
float opacity = 1.0f);
3559 inline void _checkvalid() {
if ((_lx <= 0) || (_ly <= 0) || (_stride < _lx) || (_buffer ==
nullptr))
setInvalid(); }
3567 static inline void _fast_memset(color_t* p_dest, color_t color, int32_t len);
3569 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);
3570 bool _blitClip(
int sprite_lx,
int sprite_ly,
int& dest_x,
int& dest_y,
int& sprite_x,
int& sprite_y,
int& sx,
int& sy);
3572 void _blit(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy);
3573 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); }
3574 static void _blitRegionUp(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy);
3575 static void _blitRegionDown(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy);
3577 void _blit(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3578 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); }
3579 static void _blitRegionUp(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy,
float opacity);
3580 static void _blitRegionDown(color_t* pdest,
int dest_stride, color_t* psrc,
int src_stride,
int sx,
int sy,
float opacity);
3582 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);
3583 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); }
3584 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);
3585 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);
3587 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);
3588 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); }
3589 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);
3590 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);
3592 template<
typename color_t_src,
int CACHE_SIZE,
bool USE_BLENDING,
bool USE_MASK,
bool USE_CUSTOM_OPERATOR,
typename BLEND_OPERATOR>
3593 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);
3595 void _blitRotated90(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3596 void _blitRotated180(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3597 void _blitRotated270(
const Image& sprite,
int dest_x,
int dest_y,
int sprite_x,
int sprite_y,
int sx,
int sy,
float opacity);
3599 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);
3600 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);
3601 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);
3608 template<
bool UNICOLOR_COMP,
int STACK_SIZE_BYTES>
int _scanfill(
int x,
int y, color_t border_color, color_t new_color);
3616 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)
3618 const int x = seg.X();
const int y = seg.Y();
3619 if (CHECKRANGE) {
if ((x < 0) || (y < 0) || (x >= _lx) || (y >= _ly))
return; }
3620 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); }
3621 else if (BLEND) { _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)].blend256(color, (uint32_t)op); }
3622 else { _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)] = color; }
3625 template<
bool CHECKRANGE = false>
inline TGX_INLINE
void _bseg_update_pixel(
const BSeg & seg, color_t color, int32_t op, int32_t aa)
3627 const int x = seg.X();
const int y = seg.Y();
3628 if (CHECKRANGE) {
if ((x < 0) || (y < 0) || (x >= _lx) || (y >= _ly))
return; }
3629 _buffer[TGX_CAST32(x) + TGX_CAST32(_stride) * TGX_CAST32(y)].blend256(color, (uint32_t)((op * aa)>>8));
3633 template<
int SIDE>
void _bseg_draw_template(BSeg& seg,
bool draw_first,
bool draw_last, color_t color, int32_t op,
bool checkrange);
3634 void _bseg_draw(BSeg & seg,
bool draw_first,
bool draw_last, color_t color,
int side, int32_t op,
bool checkrange);
3635 void _bseg_draw_AA(BSeg & seg,
bool draw_first,
bool draw_last, color_t color, int32_t op,
bool checkrange);
3637 template<
int SIDE>
void _bseg_avoid1_template(BSeg& segA,
bool lastA, BSeg& segB,
bool lastB, color_t color, int32_t op,
bool checkrange);
3638 void _bseg_avoid1(BSeg& PQ, BSeg& PA,
bool drawP,
bool drawQ,
bool closedPA, color_t color,
int side, int32_t op,
bool checkrange);
3639 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);
3640 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);
3641 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);
3642 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);
3643 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);
3644 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);
3645 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);
3646 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);
3652 void _bseg_fill_triangle(fVec2 fP1, fVec2 fP2, fVec2 fP3, color_t fillcolor,
float opacity);
3653 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);
3654 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);
3655 void _bseg_fill_interior_angle(iVec2 P, iVec2 Q1, iVec2 Q2, BSeg& seg1, BSeg& seg2, color_t color,
bool fill_last,
float opacity);
3656 void _bseg_fill_interior_angle_sub(
int dir,
int y,
int ytarget, BSeg& sega, BSeg& segb, color_t color,
float opacity);
3658 void _triangle_hline(
int x1,
int x2,
const int y, color_t color,
float opacity)
3661 color_t* p = _buffer + TGX_CAST32(x1) + TGX_CAST32(y) * TGX_CAST32(_stride);
3662 if (opacity < 0) {
while (x1++ <= x2) { (*p++) = color; } }
else {
while (x1++ <= x2) { (*p++).blend(color,opacity); } }
3665 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); }
3673 template<
bool CHECKRANGE,
bool CHECK_VALID_BLEND = true> TGX_INLINE
inline void _drawPixel(iVec2 pos, color_t color,
float opacity)
3675 if (CHECKRANGE) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return; }
3676 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);
3679 template<
bool CHECKRANGE> TGX_INLINE
inline void _drawPixel(iVec2 pos, color_t color)
3681 if (CHECKRANGE) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return; }
3682 _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)] = color;
3685 TGX_INLINE
inline void _drawPixel(
bool checkrange, iVec2 pos, color_t color,
float opacity)
3687 if (checkrange) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return; }
3688 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);
3691 TGX_INLINE
inline void _drawPixel(
bool checkrange, iVec2 pos, color_t color)
3693 if (checkrange) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return; }
3694 _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)] = color;
3697 template<
bool CHECKRANGE = true> TGX_INLINE
inline color_t _readPixel(iVec2 pos, color_t outside_color)
const
3699 if (CHECKRANGE) {
if ((pos.x < 0) || (pos.y < 0) || (pos.x >= _lx) || (pos.y >= _ly))
return outside_color; }
3700 return _buffer[TGX_CAST32(pos.x) + TGX_CAST32(_stride) * TGX_CAST32(pos.y)];
3703 template<
bool CHECKRANGE>
void _drawFastVLine(iVec2 pos,
int h, color_t color,
float opacity);
3704 template<
bool CHECKRANGE>
void _drawFastHLine(iVec2 pos,
int w, color_t color,
float opacity);
3705 template<
bool CHECKRANGE>
void _drawFastVLine(iVec2 pos,
int h, color_t color);
3706 template<
bool CHECKRANGE>
void _drawFastHLine(iVec2 pos,
int w, color_t color);
3708 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); }
3709 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); }
3710 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); }
3711 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); }
3712 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); }
3715 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);
3718 void _drawWedgeLine(
float ax,
float ay,
float bx,
float by,
float aw,
float bw, color_t color,
float opacity);
3719 float _wedgeLineDistance(
float pax,
float pay,
float bax,
float bay,
float dr);
3730 void _fillRect(iBox2 B, color_t color,
float opacity);
3731 template<
bool CHECKRANGE>
void _drawRoundRect(
int x,
int y,
int w,
int h,
int r, color_t color);
3732 template<
bool CHECKRANGE>
void _drawRoundRect(
int x,
int y,
int w,
int h,
int r, color_t color,
float opacity);
3733 template<
bool CHECKRANGE>
void _fillRoundRect(
int x,
int y,
int w,
int h,
int r, color_t color);
3734 template<
bool CHECKRANGE>
void _fillRoundRect(
int x,
int y,
int w,
int h,
int r, color_t color,
float opacity);
3738 void _fillSmoothRect(
const fBox2& B, color_t color,
float opacity);
3739 void _fillSmoothRoundedRect(
const tgx::iBox2& B,
float corner_radius, color_t color,
float opacity);
3740 void _drawSmoothRoundRect(
const tgx::iBox2& B,
float corner_radius, color_t color,
float opacity);
3741 void _drawSmoothWideRoundRect(
const tgx::iBox2& B,
float corner_radius,
float thickness, color_t color,
float opacity);
3754 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);
3755 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);
3777 template<
bool CHECKRANGE>
void _drawCircleHelper(
int x0,
int y0,
int r,
int cornername, color_t color,
float opacity);
3778 template<
bool CHECKRANGE>
void _fillCircleHelper(
int x0,
int y0,
int r,
int corners,
int delta, color_t color,
float opacity);
3779 template<
bool OUTLINE,
bool FILL,
bool CHECKRANGE>
void _drawFilledCircle(
int xm,
int ym,
int r, color_t color, color_t fillcolor,
float opacity);
3783 static float _rectifyAngle(
float a);
3784 static void _defaultQuarterVH(
int quarter,
int& v,
int& h);
3786 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);
3787 void _fillSmoothQuarterCircleInterHP0(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity);
3788 void _fillSmoothQuarterCircleInterHP1(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg1,
int side1);
3789 void _fillSmoothQuarterCircleInterHP2(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg1,
int side1,
const BSeg& seg2,
int side2);
3790 void _fillSmoothCircleInterHP(
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg,
int side);
3792 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);
3793 void _drawSmoothQuarterCircleInterHP0(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity);
3794 void _drawSmoothQuarterCircleInterHP1(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg1,
int side1);
3795 void _drawSmoothQuarterCircleInterHP2(
int quarter,
tgx::fVec2 C,
float R, color_t color,
float opacity,
const BSeg& seg1,
int side1,
const BSeg& seg2,
int side2);
3797 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);
3798 void _drawSmoothThickQuarterCircleInterHP0(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color,
float opacity);
3799 void _drawSmoothThickQuarterCircleInterHP1(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color,
float opacity,
const BSeg& seg1,
int side1);
3800 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);
3802 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);
3803 void _fillSmoothThickQuarterCircleInterHP0(
int quarter,
tgx::fVec2 C,
float R,
float thickness, color_t color_interior, color_t color_border,
float opacity);
3804 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);
3805 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);
3815 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);
3818 void _drawSmoothQuarterEllipse(
tgx::fVec2 C,
float rx,
float ry,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color,
float opacity);
3819 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);
3820 void _fillSmoothQuarterEllipse(
tgx::fVec2 C,
float rx,
float ry,
int quarter,
bool vertical_center_line,
bool horizontal_center_line, color_t color,
float opacity);
3821 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);
3831 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);
3832 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);
3833 void _drawQuadBezier(iVec2 P1, iVec2 P2, iVec2 PC,
float wc,
bool drawP2, color_t color,
float opacity);
3835 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);
3836 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);
3837 void _drawCubicBezier(iVec2 P1, iVec2 P2, iVec2 PA, iVec2 PB,
bool drawP2, color_t color,
float opacity);
3839 void _plotQuadSpline(
int n,
int x[],
int y[],
bool draw_last,
const color_t color,
const float opacity);
3840 template<
int SPLINE_MAX_POINTS>
void _drawQuadSpline(
int nbpoints,
const iVec2* tabPoints,
bool draw_last_point, color_t color,
float opacity);
3842 void _plotClosedSpline(
int n,
int x[],
int y[],
const color_t color,
const float opacity);
3843 template<
int SPLINE_MAX_POINTS>
void _drawClosedSpline(
int nbpoints,
const iVec2* tabPoints, color_t color,
float opacity);
3845 void _plotCubicSpline(
int n,
int x[],
int y[],
bool draw_last,
const color_t color,
const float opacity);
3846 template<
int SPLINE_MAX_POINTS>
void _drawCubicSpline(
int nbpoints,
const iVec2* tabPoints,
bool draw_last_point, color_t color,
float opacity);
3851 static bool _splitRationalQuadBezier(fVec2 P1, fVec2 P2, fVec2 PC,
float w, fVec2& Q, fVec2& PB,
float& wb);
3852 static bool _splitCubicBezier(fVec2 P1, fVec2 P2, fVec2 PPC1, fVec2 PPC2, fVec2& Q, fVec2& C, fVec2 & D);
3860 bool _clipit(
int& x,
int& y,
int& sx,
int& sy,
int& b_left,
int& b_up);
3862 template<
bool BLEND>
iVec2 _drawCharGFX(
char c, iVec2 pos, color_t col,
const GFXfont& font,
float opacity);
3863 template<
bool BLEND>
iVec2 _drawCharILI(
char c, iVec2 pos, color_t col,
const ILI9341_t3_font_t& font,
float opacity);
3865 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);
3866 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);
3868 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);
3869 template<
bool BLEND>
static void _drawcharline(
const uint8_t* bitmap, int32_t off, color_t* p,
int dx, color_t col,
float opacity);
3870 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);
3871 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);
3872 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);
3873 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);
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:180
TGX_INLINE T max(const T &a, const T &b)
Don't know why but much faster than fmaxf() for floats.
Definition: Misc.h:184
#define TGX_DEFAULT_NO_BLENDING
Default blending operation for drawing primitive: overwrite instead of blending.
Definition: Misc.h:67
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:143
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:370
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:386
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:535
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:412
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:508
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 an 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 consecutif 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 an 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:572
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 an 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:3428
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:495
TGX_INLINE color_t & operator()(iVec2 pos)
Get a reference to a pixel (no range check!)
Definition: Image.h:546
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:354
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 consecutif 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:479
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:338
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:559
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:453
TGX_INLINE iVec2 dim() const
Return the image dimensions as an iVec2.
Definition: Image.h:394
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:422
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:402
void drawPolylineAA(FUNCTOR_NEXT next_point, color_t color, float opacity=1.0f)
Draw a polyline ie a sequence of consecutif segments [P0,P1] , [P1,P2],,, [Pn-1,Pn] (High quality).
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 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 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 consecutif 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 an 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:362
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:378
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 consecutif 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 consecutif 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:523
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 assignement operator.
TGX_INLINE void drawPixelf(fVec2 pos, color_t color)
Set a pixel at a given position (floating point coord).
Definition: Image.h:465
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:154
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