FastLED 3.10.10
Loading...
Searching...
No Matches
canvas.h File Reference

Detailed Description

Canvas types for gfx primitives (implementation)

Definition in file canvas.h.

#include "fl/math/alpha.h"
#include "fl/math/xymap.h"
#include "fl/gfx/draw_mode.h"
#include "fl/stl/int.h"
#include "fl/stl/span.h"
#include "fl/stl/variant.h"
#include "fl/stl/shared_ptr.h"
#include "fl/stl/noexcept.h"
#include "fl/system/sketch_macros.h"
+ Include dependency graph for canvas.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fl::gfx::Canvas< RGB_T >
 Simple rectangular canvas for graphics operations Combines a pixel buffer with dimensions for cache-optimal drawing. More...
 
struct  fl::gfx::CanvasMapped< RGB_T >
 XYMap-backed canvas for non-rectangular or remapped layouts. More...
 
struct  fl::gfx::PolyPoint< Coord >
 Polygon vertex (x, y coordinate pair) for drawPolygon C++11 aggregate: PolyPoint<float> p{3.5f, 2.0f};. More...
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 
namespace  fl::gfx
 

Macros

#define FL_GFX_POLYGON_DEFAULT_CHUNK   64
 
#define FL_GFX_POLYGON_DEFAULT_MAXN   32
 Default drawPolygon tier (MAXN vertex cap, CHUNK accumulator px) Both kernels keep their whole working set on the stack, sized by MAXN (and CHUNK for Exact).
 

Enumerations

enum class  fl::gfx::LineCap { fl::gfx::FLAT , fl::gfx::ROUND , fl::gfx::SQUARE }
 Line cap styles for stroke operations. More...
 
enum class  fl::gfx::PolyFill { fl::gfx::Exact , fl::gfx::ABuffer }
 Fill backend for drawPolygon Both backends use the even-odd rule and the same row/vertex conventions; they differ in the per-pixel coverage model: More...
 

Functions

template<int hRadius, int vRadius, typename RGB_T>
void fl::gfx::blurGaussian (Canvas< RGB_T > &canvas) FL_NO_EXCEPT
 Convenience overload with no dimming.
 
template<int hRadius, int vRadius, typename RGB_T>
void fl::gfx::blurGaussian (Canvas< RGB_T > &canvas, alpha16 dimFactor) FL_NO_EXCEPT
 Higher-precision dim overload (UNORM16).
 
template<int hRadius, int vRadius, typename RGB_T>
void fl::gfx::blurGaussian (Canvas< RGB_T > &canvas, alpha8 dimFactor) FL_NO_EXCEPT
 Compile-time Gaussian blur with independent H/V radii.
 
template<int hRadius, int vRadius, typename RGB_T>
void fl::gfx::blurGaussian (CanvasMapped< RGB_T > &canvas) FL_NO_EXCEPT
 
template<int hRadius, int vRadius, typename RGB_T>
void fl::gfx::blurGaussian (CanvasMapped< RGB_T > &canvas, alpha16 dimFactor) FL_NO_EXCEPT
 Higher-precision dim overload for CanvasMapped (UNORM16).
 
template<int hRadius, int vRadius, typename RGB_T>
void fl::gfx::blurGaussian (CanvasMapped< RGB_T > &canvas, alpha8 dimFactor) FL_NO_EXCEPT
 XYMap-backed Gaussian blur (non-optimized, per-pixel path).
 
template<typename PixelT, typename Coord>
void fl::gfx::drawDisc (Canvas< PixelT > &canvas, const PixelT &color, Coord cx, Coord cy, Coord r, fl::DrawMode mode=fl::DrawMode::DRAW_MODE_BLEND) FL_NO_EXCEPT
 
template<typename PixelT, typename Coord>
void fl::gfx::drawLine (Canvas< PixelT > &canvas, const PixelT &color, Coord x0, Coord y0, Coord x1, Coord y1, fl::DrawMode mode) FL_NO_EXCEPT
 ============================================================================
 
template<typename PixelT, typename Coord, int N, int MAXN = FL_GFX_POLYGON_DEFAULT_MAXN, int CHUNK = FL_GFX_POLYGON_DEFAULT_CHUNK, PolyFill Fill = PolyFill::Exact>
void fl::gfx::drawPolygon (Canvas< PixelT > &canvas, const PixelT &color, const PolyPoint< Coord >(&pts)[N], fl::DrawMode mode=fl::DrawMode::DRAW_MODE_BLEND) FL_NO_EXCEPT
 
template<typename PixelT, typename Coord, int MAXN = FL_GFX_POLYGON_DEFAULT_MAXN, int CHUNK = FL_GFX_POLYGON_DEFAULT_CHUNK, PolyFill Fill = PolyFill::Exact>
void fl::gfx::drawPolygon (Canvas< PixelT > &canvas, const PixelT &color, fl::span< const PolyPoint< Coord > > pts, fl::DrawMode mode=fl::DrawMode::DRAW_MODE_BLEND) FL_NO_EXCEPT
 Fill selects the polygon backend (PolyFill::Exact by default; PolyFill::ABuffer for the faster 8x4 A-buffer kernel, which ignores CHUNK).
 
template<typename PixelT, typename Coord>
void fl::gfx::drawRing (Canvas< PixelT > &canvas, const PixelT &color, Coord cx, Coord cy, Coord r, Coord thickness, fl::DrawMode mode=fl::DrawMode::DRAW_MODE_BLEND) FL_NO_EXCEPT
 
template<typename PixelT, typename Coord>
void fl::gfx::drawStrokeLine (Canvas< PixelT > &canvas, const PixelT &color, Coord x0, Coord y0, Coord x1, Coord y1, Coord thickness, LineCap cap, fl::DrawMode mode=fl::DrawMode::DRAW_MODE_BLEND) FL_NO_EXCEPT
 

Class Documentation

◆ fl::gfx::PolyPoint

struct fl::gfx::PolyPoint
Class Members
Coord x
Coord y