OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
Loading...
Searching...
No Matches
PixelVectorHelper Struct Reference

Helper class to wrap around pixel vectors. More...

#include <OutputHardware.hpp>

Public Types

using size_type = typename ::std::vector<Pixel>::size_type
 Size type of this vector.
 
using vector_type = typename ::std::vector<Pixel>
 Type of the backing variable.
 

Static Public Member Functions

static void shift (vector_type &data, size_type from_index, size_type to_index, size_type shift=1)
 Shift the contents of a vector up (right) or down (left)
 
static void shift_left (vector_type &data, size_type count) noexcept
 Shift left (or down)
 
static void shift_right (vector_type &data, size_type count) noexcept
 Shift right (or up)
 
static void fill (vector_type &data, const Pixel &color) noexcept
 Fill the entire vector with a pixel color.
 
static void fill (vector_type &data, size_type fromIndex, size_type toIndex, const Pixel &color) noexcept
 Fill a segment with a pixel color.
 

Detailed Description

Helper class to wrap around pixel vectors.

Definition at line 31 of file OutputHardware.hpp.

Member Typedef Documentation

◆ size_type

using PixelVectorHelper::size_type = typename ::std::vector<Pixel>::size_type

Size type of this vector.

Definition at line 35 of file OutputHardware.hpp.

◆ vector_type

using PixelVectorHelper::vector_type = typename ::std::vector<Pixel>

Type of the backing variable.

Definition at line 38 of file OutputHardware.hpp.

Member Function Documentation

◆ fill() [1/2]

static void PixelVectorHelper::fill ( vector_type & data,
const Pixel & color )
staticnoexcept

Fill the entire vector with a pixel color.

Parameters
[in,out]dataPixel vector
colorPixel color

◆ fill() [2/2]

static void PixelVectorHelper::fill ( vector_type & data,
size_type fromIndex,
size_type toIndex,
const Pixel & color )
staticnoexcept

Fill a segment with a pixel color.

Parameters
[in,out]dataPixel vector
colorPixel color
fromIndexSegment start index (inclusive)
toIndexSegment end index (inclusive)

◆ shift()

static void PixelVectorHelper::shift ( vector_type & data,
size_type from_index,
size_type to_index,
size_type shift = 1 )
static

Shift the contents of a vector up (right) or down (left)

Note
if from_index is greater than to_index, contents are shifted down, otherwise, contents are shifted up.
The pixel that overflows in one end is reintroduced in the other end
Parameters
[in,out]dataPixel vector
from_indexIndex where shifting starts (inclusive)
to_indexIndex where shifting ends (inclusive)
shiftCount of pixels to be shifted

◆ shift_left()

static void PixelVectorHelper::shift_left ( vector_type & data,
size_type count )
staticnoexcept

Shift left (or down)

Parameters
[in,out]dataPixel vector
countNumber of pixels to shift

◆ shift_right()

static void PixelVectorHelper::shift_right ( vector_type & data,
size_type count )
staticnoexcept

Shift right (or up)

Parameters
[in,out]dataPixel vector
countNumber of pixels to shift

The documentation for this struct was generated from the following file: