17#ifndef FASTLED_RASTER_SPARSE_INLINED_COUNT
18#define FASTLED_RASTER_SPARSE_INLINED_COUNT 128
82 const rect<u16> *optional_bounds =
nullptr);
108 bool min_x_set =
false;
110 bool min_y_set =
false;
112 bool max_x_set =
false;
114 bool max_y_set =
false;
117 if (!min_x_set || pt.
x < min_x) {
121 if (!min_y_set || pt.
y < min_y) {
125 if (!max_x_set || pt.
x > max_x) {
129 if (!max_y_set || pt.
y > max_y) {
134 return rect<u16>(min_x, min_y, max_x + 1, max_y + 1);
149 template <
typename XYVisitor>
153 if (!
xymap.has(pt.x, pt.y)) {
156 u32 index =
xymap(pt.x, pt.y);
159 visitor.draw(pt, index,
value);
170 u8 **cached =
mCache.find_value(pt);
273 if (val !=
nullptr) {
288 bool min_x_set =
false;
290 bool min_y_set =
false;
292 bool max_x_set =
false;
294 bool max_y_set =
false;
297 if (!min_x_set || pt.
x < min_x) {
301 if (!min_y_set || pt.
y < min_y) {
305 if (!max_x_set || pt.
x > max_x) {
309 if (!max_y_set || pt.
y > max_y) {
314 return rect<u16>(min_x, min_y, max_x + 1, max_y + 1);
326 template <
typename XYVisitor>
330 if (!
xymap.has(pt.x, pt.y)) {
333 u32 index =
xymap(pt.x, pt.y);
334 const CRGB &color = it.second;
336 if (color.r != 0 || color.g != 0 || color.b != 0) {
337 visitor.draw(pt, index, color);
fl::rect< u16 > mAbsoluteBounds
XYRasterSparse_RGB8() FL_NOEXCEPT=default
fl::unordered_map< vec2< u16 >, CRGB >::iterator iterator
unordered_map< vec2< u16 >, CRGB *, FastHashKey, EqualToKey, kMaxCacheSize > mCache
void setSize(u16 width, u16 height)
const_iterator begin() const
XYRasterSparse_RGB8 & reset()
void setBounds(const rect< u16 > &bounds)
void write(const vec2< u16 > &pt, const CRGB &color)
rect< u16 > bounds_pixels() const
void draw(const XYMap &xymap, fl::span< CRGB > out)
const_iterator end() const
XYRasterSparse_RGB8 & operator=(XYRasterSparse_RGB8 &&) FL_NOEXCEPT=default
XYRasterSparse_RGB8 & clear()
static const int kMaxCacheSize
fl::unordered_map< vec2< u16 >, CRGB >::const_iterator const_iterator
XYRasterSparse_RGB8(const XYRasterSparse_RGB8 &) FL_NOEXCEPT=default
rect< u16 > bounds() const
void rasterize(const vec2< u16 > &pt, const CRGB &color)
EqualTo< Key > EqualToKey
void draw(const XYMap &xymap, XYVisitor &visitor)
fl::unordered_map< Key, Value, HashKey, EqualToKey, FASTLED_HASHMAP_INLINED_COUNT > HashMapLarge
FastHash< Key > FastHashKey
pair< bool, CRGB > at(u16 x, u16 y) const
void rasterize(const vec2< u16 > &pt, u8 value)
XYRasterU8Sparse() FL_NOEXCEPT=default
void setBounds(const rect< u16 > &bounds)
void draw(const XYMap &xymap, XYVisitor &visitor)
XYRasterU8Sparse & clear()
void draw(const CRGB &color, const XYMap &xymap, fl::span< CRGB > out)
pair< bool, u8 > at(u16 x, u16 y) const
XYRasterU8Sparse & operator=(XYRasterU8Sparse &&) FL_NOEXCEPT=default
fl::unordered_map< vec2< u16 >, u8 >::iterator iterator
void rasterize(const Tile2x2_u8 &tile)
const_iterator begin() const
static const int kMaxCacheSize
XYRasterU8Sparse(const XYRasterU8Sparse &) FL_NOEXCEPT=default
fl::rect< u16 > mAbsoluteBounds
rect< u16 > bounds() const
EqualTo< Key > EqualToKey
fl::unordered_map< vec2< u16 >, u8 >::const_iterator const_iterator
void drawGradient(const Gradient &gradient, const XYMap &xymap, fl::span< CRGB > out)
rect< u16 > bounds_pixels() const
const_iterator end() const
FastHash< Key > FastHashKey
void setSize(u16 width, u16 height)
XYRasterU8Sparse & reset()
fl::unordered_map< Key, Value, HashKey, EqualToKey, FASTLED_HASHMAP_INLINED_COUNT > HashMapLarge
unordered_map< vec2< u16 >, u8 *, FastHashKey, EqualToKey, kMaxCacheSize > mCache
void rasterize_internal(const Tile2x2_u8 &tile, const rect< u16 > *optional_bounds=nullptr)
void write(const vec2< u16 > &pt, u8 value)
constexpr int type_rank< T >::value
XYRasterSparse_RGB8 XYRasterSparse_CRGB
Base definition for an LED controller.
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Representation of an 8-bit RGB pixel (Red, Green, Blue)
u16 width() const FL_NOEXCEPT
u16 height() const FL_NOEXCEPT
#define FASTLED_HASHMAP_INLINED_COUNT