32 : m_impl{
std::move(impl)}, m_size{size} {}
38 size_t size()
const {
return m_size; }
65 void ApplyTo(std::span<frc::AddressableLED::LEDData> data,
80 void ApplyTo(std::span<frc::AddressableLED::LEDData> data)
const;
154 units::meter_t ledSpacing);
340 std::initializer_list<std::pair<double, Color>> steps);
387 std::initializer_list<Color> colors);
Definition AddressableLED.h:33
Represents colors that can be used with Addressable LEDs.
Definition Color.h:24
A wrapper around a length and an arbitrary reader function that accepts an LED index and returns data...
Definition LEDPattern.h:28
frc::AddressableLED::LEDData operator[](size_t index) const
Definition LEDPattern.h:34
LEDReader(std::function< frc::AddressableLED::LEDData(int)> impl, size_t size)
Definition LEDPattern.h:30
size_t size() const
Definition LEDPattern.h:38
Definition LEDPattern.h:21
LEDPattern Breathe(units::second_t period)
Creates a pattern that brightens and dims this one over time.
LEDPattern(std::function< void(frc::LEDPattern::LEDReader, std::function< void(int, frc::Color)>)> impl)
LEDPattern Blink(units::second_t onTime, units::second_t offTime)
Creates a pattern that switches between playing this pattern and turning the entire LED strip off.
LEDPattern MapIndex(std::function< size_t(size_t, size_t)> indexMapper)
Creates a pattern with remapped indices.
LEDPattern SynchronizedBlink(std::function< bool()> signal)
Creates a pattern that blinks this one on and off in sync with a true/false signal.
static LEDPattern Solid(const Color color)
Creates a pattern that displays a single static color along the entire length of the LED strip.
LEDPattern AtBrightness(double relativeBrightness)
Creates a pattern that plays this one, but at a different brightness.
LEDPattern Blend(const LEDPattern &other)
Creates a pattern that displays outputs as a combination of this pattern and another.
GradientType
Types of gradients.
Definition LEDPattern.h:343
@ kContinuous
A continuous gradient, where the gradient wraps around to allow for seamless scrolling effects.
Definition LEDPattern.h:348
@ kDiscontinuous
A discontinuous gradient, where the first pixel is set to the first color of the gradient and the fin...
Definition LEDPattern.h:355
static LEDPattern Gradient(GradientType type, std::span< const Color > colors)
Creates a pattern that displays a non-animated gradient of colors across the entire length of the LED...
static LEDPattern Gradient(GradientType type, std::initializer_list< Color > colors)
Creates a pattern that displays a non-animated gradient of colors across the entire length of the LED...
void ApplyTo(std::span< frc::AddressableLED::LEDData > data) const
Writes the pattern to an LED buffer.
void ApplyTo(std::span< frc::AddressableLED::LEDData > data, std::function< void(int, frc::Color)> writer) const
Writes the pattern to an LED buffer.
LEDPattern ScrollAtRelativeSpeed(units::hertz_t velocity)
Creates a pattern that plays this one scrolling up the buffer.
LEDPattern Mask(const LEDPattern &mask)
Similar to LEDPattern::Blend(const LEDPattern&), but performs a bitwise mask on each color channel ra...
LEDPattern Reversed()
Creates a pattern that displays this one in reverse.
static LEDPattern Rainbow(int saturation, int value)
Creates an LED pattern that displays a rainbow across the color wheel.
static LEDPattern Steps(std::span< const std::pair< double, Color > > steps)
Display a set of colors in steps across the length of the LED strip.
LEDPattern OverlayOn(const LEDPattern &base)
Creates a pattern that plays this pattern overlaid on another.
LEDPattern ScrollAtAbsoluteSpeed(units::meters_per_second_t velocity, units::meter_t ledSpacing)
Creates a pattern that plays this one scrolling up an LED strip.
static LEDPattern ProgressMaskLayer(std::function< double()> progressFunction)
Creates a pattern that works as a mask layer for LEDPattern::Mask(const LEDPattern&) that illuminates...
LEDPattern Blink(units::second_t onTime)
Like LEDPattern::Blink(units::second_t), but where the "off" time is exactly equal to the "on" time.
static LEDPattern Off()
A pattern that turns off all LEDs.
static LEDPattern Steps(std::initializer_list< std::pair< double, Color > > steps)
Display a set of colors in steps across the length of the LED strip.
LEDPattern OffsetBy(int offset)
Creates a pattern that displays this one, but offset by a certain number of LEDs.
void ApplyTo(LEDReader reader, std::function< void(int, frc::Color)> writer) const
Implement std::hash so that hash_code can be used in STL containers.
Definition PointerIntPair.h:280
color
Definition color.h:16