48 for (
int x = 0;
x < 2; ++
x) {
49 for (
int y = 0;
y < 2; ++
y) {
58 at(0, 0) = {wrap_x(
vec2<u16>(origin.
x, origin.
y), width), from.
at(0, 0)};
59 at(0, 1) = {wrap_x(
vec2<u16>(origin.
x, origin.
y + 1), width), from.
at(0, 1)};
60 at(1, 0) = {wrap_x(
vec2<u16>(origin.
x + 1, origin.
y), width), from.
at(1, 0)};
61 at(1, 1) = {wrap_x(
vec2<u16>(origin.
x + 1, origin.
y + 1), width),
74 mData[0][0] = data[0][0];
75 mData[0][1] = data[0][1];
76 mData[1][0] = data[1][0];
77 mData[1][1] = data[1][1];
104 max =
MAX(max,
at(0, 0));
105 max =
MAX(max,
at(0, 1));
106 max =
MAX(max,
at(1, 0));
107 max =
MAX(max,
at(1, 1));
113 for (
int x = 0;
x < 2; ++
x) {
114 for (
int y = 0;
y < 2; ++
y) {
144 for (u16
x = 0;
x < 2; ++
x) {
145 for (u16
y = 0;
y < 2; ++
y) {
146 const auto& data_a = a.
at(
x,
y);
147 const auto& data_b = b.
at(
x,
y);
154 u8 alpha_a = data_a.second;
155 u8 alpha_b = data_b.second;
158 float alpha_float = alpha_a +
t * (alpha_b - alpha_a);
159 u8 interpolated_alpha =
static_cast<u8>(alpha_float + 0.5f);
161 interpolated.
mData[
y][
x] = {
pos, interpolated_alpha};
165 result.push_back(interpolated);
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
fl::pair< vec2< u16 >, u8 > Entry
static vector_fixed< Tile2x2_u8_wrap, 2 > Interpolate(const Tile2x2_u8_wrap &a, const Tile2x2_u8_wrap &b, float t)
static Tile2x2_u8 MaxTile(const Tile2x2_u8 &a, const Tile2x2_u8 &b)
static void Rasterize(const span< const Tile2x2_u8 > &tiles, XYRasterU8Sparse *output)
void draw(const CRGB &color, const XYMap &xymap, CRGB *out) const
vec2< u16 > origin() const
rect< u16 > bounds() const
bounds => [begin_x, end_x) (where end_x is exclusive)
void rasterize(const vec2< u16 > &pt, u8 value)
Result type for promise operations.
Defines the red, green, and blue (RGB) pixel struct.
static vec2< u16 > wrap_x(const vec2< u16 > &v, const u16 width)
static vec2< u16 > wrap(const vec2< u16 > &v, const vec2< u16 > &size)
FixedVector< T, INLINED_SIZE > vector_fixed
Representation of an RGB pixel (Red, Green, Blue)