17 uint16_t width, uint16_t height) {
21 return (
y + 1) * width - 1 -
x;
27 uint16_t width, uint16_t height) {
33typedef uint16_t (*
XYFunction)(uint16_t
x, uint16_t
y, uint16_t width,
50 const uint16_t *lookUpTable,
80 }
else if (uint16_t(
x) >=
width) {
85 }
else if (uint16_t(
y) >=
height) {
XyMapType getType() const
static XYMap constructWithLookUpTable(uint16_t width, uint16_t height, const uint16_t *lookUpTable, uint16_t offset=0)
static XYMap constructSerpentine(uint16_t width, uint16_t height, uint16_t offset=0)
uint16_t getWidth() const
uint16_t operator()(uint16_t x, uint16_t y) const
fl::ScreenMap toScreenMap() const
XYMap(const XYMap &other)=default
void mapPixels(const CRGB *input, CRGB *output) const
uint16_t mapToIndex(int x, int y) const
void convertToLookUpTable()
XYMap(uint16_t width, uint16_t height, bool is_serpentine=true, uint16_t offset=0)
uint16_t mapToIndex(uint16_t x, uint16_t y) const
static XYMap constructRectangularGrid(uint16_t width, uint16_t height, uint16_t offset=0)
uint16_t getHeight() const
XYMap & operator=(const XYMap &other)=default
fl::LUT16Ptr mLookUpTable
void setRectangularGrid()
static XYMap constructWithUserFunction(uint16_t width, uint16_t height, XYFunction xyFunction, uint16_t offset=0)
uint16_t getTotal() const
Defines the red, green, and blue (RGB) pixel struct.
#define FASTLED_FORCE_INLINE
Implements the FastLED namespace macros.
FASTLED_FORCE_INLINE uint16_t xy_serpentine(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
FASTLED_FORCE_INLINE uint16_t xy_line_by_line(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
uint16_t(* XYFunction)(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
Implements a simple red square effect for 2D LED grids.
Representation of an RGB pixel (Red, Green, Blue)