18 uint16_t width, uint16_t height) {
22 return (
y + 1) * width - 1 -
x;
28 uint16_t width, uint16_t height) {
34typedef uint16_t (*
XYFunction)(uint16_t
x, uint16_t
y, uint16_t width,
55 const uint16_t *lookUpTable,
85 uint16_t
mapToIndex(
const uint16_t &
x,
const uint16_t &
y)
const;
87 template <
typename IntType,
95 bool has(uint16_t
x, uint16_t
y)
const {
100 return (
x >= 0) && (
y >= 0) &&
has((uint16_t)
x, (uint16_t)
y);
XyMapType getType() const
uint16_t mapToIndex(IntType x, IntType y) 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
bool isSerpentineOrLineByLine() const
uint16_t operator()(uint16_t x, uint16_t y) const
fl::ScreenMap toScreenMap() const
uint16_t mapToIndex(const uint16_t &x, const uint16_t &y) const
XYMap(const XYMap &other)=default
void mapPixels(const CRGB *input, CRGB *output) const
bool has(int x, int y) const
void convertToLookUpTable()
bool isRectangularGrid() const
XYMap(uint16_t width, uint16_t height, bool is_serpentine=true, uint16_t offset=0)
static XYMap constructRectangularGrid(uint16_t width, uint16_t height, uint16_t offset=0)
static XYMap identity(uint16_t width, uint16_t height)
uint16_t getHeight() const
bool isLineByLine() const
bool has(uint16_t x, uint16_t y) const
bool isSerpentine() 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.
UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
#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 T clamp(T value, T min, T max)
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)
typename enable_if< Condition, T >::type enable_if_t
Implements a simple red square effect for 2D LED grids.
Representation of an RGB pixel (Red, Green, Blue)