12#include "wpi/units/frequency.hpp"
13#include "wpi/units/length.hpp"
14#include "wpi/units/time.hpp"
15#include "wpi/units/velocity.hpp"
37 size_t size()
const {
return m_size; }
65 void ApplyTo(std::span<wpi::AddressableLED::LEDData> data,
80 void ApplyTo(std::span<wpi::AddressableLED::LEDData> data)
const;
154 wpi::units::meter_t ledSpacing);
326 std::span<
const std::pair<double, wpi::util::Color>> steps);
341 std::initializer_list<std::pair<double, wpi::util::Color>> steps);
373 std::span<const wpi::util::Color> colors);
389 std::initializer_list<wpi::util::Color> colors);
@ index
Definition base.h:690
Definition AddressableLED.hpp:45
A wrapper around a length and an arbitrary reader function that accepts an LED index and returns data...
Definition LEDPattern.hpp:27
size_t size() const
Definition LEDPattern.hpp:37
LEDReader(std::function< wpi::AddressableLED::LEDData(int)> impl, size_t size)
Definition LEDPattern.hpp:29
wpi::AddressableLED::LEDData operator[](size_t index) const
Definition LEDPattern.hpp:33
LEDPattern(std::function< void(wpi::LEDPattern::LEDReader, std::function< void(int, wpi::util::Color)>)> impl)
void ApplyTo(LEDReader reader, std::function< void(int, wpi::util::Color)> writer) const
static LEDPattern ProgressMaskLayer(std::function< double()> progressFunction)
Creates a pattern that works as a mask layer for LEDPattern::Mask(const LEDPattern&) that illuminates...
LEDPattern Breathe(wpi::units::second_t period)
Creates a pattern that brightens and dims this one over time.
GradientType
Types of gradients.
Definition LEDPattern.hpp:344
@ kDiscontinuous
A discontinuous gradient, where the first pixel is set to the first color of the gradient and the fin...
Definition LEDPattern.hpp:356
@ kContinuous
A continuous gradient, where the gradient wraps around to allow for seamless scrolling effects.
Definition LEDPattern.hpp:349
LEDPattern AtBrightness(double relativeBrightness)
Creates a pattern that plays this one, but at a different brightness.
void ApplyTo(std::span< wpi::AddressableLED::LEDData > data, std::function< void(int, wpi::util::Color)> writer) const
Writes the pattern to an LED buffer.
LEDPattern ScrollAtAbsoluteVelocity(wpi::units::meters_per_second_t velocity, wpi::units::meter_t ledSpacing)
Creates a pattern that plays this one scrolling up an LED strip.
LEDPattern Blink(wpi::units::second_t onTime, wpi::units::second_t offTime)
Creates a pattern that switches between playing this pattern and turning the entire LED strip off.
LEDPattern Blink(wpi::units::second_t onTime)
Like LEDPattern::Blink(wpi::units::second_t), but where the "off" time is exactly equal to the "on" t...
LEDPattern Blend(const LEDPattern &other)
Creates a pattern that displays outputs as a combination of this pattern and another.
LEDPattern Mask(const LEDPattern &mask)
Similar to LEDPattern::Blend(const LEDPattern&), but performs a bitwise mask on each color channel ra...
static LEDPattern Steps(std::initializer_list< std::pair< double, wpi::util::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.
LEDPattern ScrollAtRelativeVelocity(wpi::units::hertz_t velocity)
Creates a pattern that plays this one scrolling up the buffer.
LEDPattern MapIndex(std::function< size_t(size_t, size_t)> indexMapper)
Creates a pattern with remapped indices.
static LEDPattern Rainbow(int saturation, int value)
Creates an LED pattern that displays a rainbow across the color wheel.
LEDPattern Reversed()
Creates a pattern that displays this one in reverse.
static LEDPattern Solid(const wpi::util::Color color)
Creates a pattern that displays a single static color along the entire length of the LED strip.
LEDPattern OverlayOn(const LEDPattern &base)
Creates a pattern that plays this pattern overlaid on another.
static LEDPattern Off()
A pattern that turns off all LEDs.
static LEDPattern Steps(std::span< const std::pair< double, wpi::util::Color > > steps)
Display a set of colors in steps across the length of the LED strip.
static LEDPattern Gradient(GradientType type, std::span< const wpi::util::Color > colors)
Creates a pattern that displays a non-animated gradient of colors across the entire length of the LED...
LEDPattern SynchronizedBlink(std::function< bool()> signal)
Creates a pattern that blinks this one on and off in sync with a true/false signal.
void ApplyTo(std::span< wpi::AddressableLED::LEDData > data) const
Writes the pattern to an LED buffer.
static LEDPattern Gradient(GradientType type, std::initializer_list< wpi::util::Color > colors)
Creates a pattern that displays a non-animated gradient of colors across the entire length of the LED...
Represents colors that can be used with Addressable LEDs.
Definition Color.hpp:42
color
Definition color.h:16
Definition StringMap.hpp:773
Definition RobotBase.hpp:26
Definition CvSource.hpp:15