26#ifndef FASTLED_RASTER_SPARSE_INLINED_COUNT
27#define FASTLED_RASTER_SPARSE_INLINED_COUNT 128
82 const rect<int> *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<int>(min_x, min_y, max_x + 1, max_y + 1);
147 template <
typename XYVisitor>
151 if (!
xymap.has(pt.x, pt.y)) {
154 uint32_t index =
xymap(pt.x, pt.y);
155 uint8_t value = it.second;
157 visitor.draw(pt, index, value);
168 uint8_t **cached =
mCache.find_value(pt);
170 uint8_t *val = *cached;
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
void write(const vec2< int > &pt, uint8_t value)
fl::HashMap< Key, Value, HashKey, EqualToKey, FASTLED_HASHMAP_INLINED_COUNT > HashMapLarge
void setBounds(const rect< int > &bounds)
void draw(const XYMap &xymap, XYVisitor &visitor)
void setSize(uint16_t width, uint16_t height)
XYRasterU8Sparse & clear()
XYRasterU8Sparse(int width, int height)
XYRasterU8Sparse()=default
fl::HashMap< vec2< int >, uint8_t >::const_iterator const_iterator
void rasterize(const Tile2x2_u8 &tile)
const_iterator begin() const
static const int kMaxCacheSize
fl::rect< int > mAbsoluteBounds
Pair< bool, uint8_t > at(uint16_t x, uint16_t y) const
EqualTo< Key > EqualToKey
HashMap< vec2< int >, uint8_t *, FastHashKey, EqualToKey, kMaxCacheSize > mCache
void rasterize_internal(const Tile2x2_u8 &tile, const rect< int > *optional_bounds=nullptr)
XYRasterU8Sparse(const XYRasterU8Sparse &)=delete
fl::HashMap< vec2< int >, uint8_t >::iterator iterator
const_iterator end() const
FastHash< Key > FastHashKey
XYRasterU8Sparse & reset()
void draw(const CRGB &color, const XYMap &xymap, CRGB *out)
void drawGradient(const Gradient &gradient, const XYMap &xymap, CRGB *out)
rect< int > bounds_pixels() const
rect< int > bounds() const
void rasterize(const vec2< int > &pt, uint8_t value)
#define FASTLED_HASHMAP_INLINED_COUNT
#define FASTLED_NAMESPACE_END
Implements the FastLED namespace macros.
Implements a simple red square effect for 2D LED grids.
Representation of an RGB pixel (Red, Green, Blue)