FastLED 3.6.0
Loading...
Searching...
No Matches
CHSV Struct Reference

Detailed Description

Representation of an HSV pixel (hue, saturation, value (aka brightness)).

Examples
AnalogOutput.ino, ColorPalette.ino, Cylon.ino, DemoReel100.ino, Noise.ino, NoisePlusPalette.ino, OctoWS2811Demo.ino, ParallelOutputDemo.ino, Pride2015.ino, RGBSetDemo.ino, SmartMatrix.ino, and XYMatrix.ino.

Definition at line 27 of file pixeltypes.h.

#include <pixeltypes.h>

Public Member Functions

uint8_t & operator[] (uint8_t x)
 Array access operator to index into the CHSV object.
 
const uint8_t & operator[] (uint8_t x) const
 Array access operator to index into the CHSV object.
 
 CHSV ()=default
 Default constructor.
 
 CHSV (uint8_t ih, uint8_t is, uint8_t iv)
 Allow construction from hue, saturation, and value.
 
 CHSV (const CHSV &rhs)=default
 Allow copy construction.
 
CHSVoperator= (const CHSV &rhs)=default
 Allow copy construction.
 
CHSVsetHSV (uint8_t ih, uint8_t is, uint8_t iv)
 Assign new HSV values.
 

Public Attributes

union { 
 
   struct { 
 
      union { 
 
         uint8_t   hue 
 Color hue. More...
 
         uint8_t   h 
 Color hue. More...
 
      }  
 
      union { 
 
         uint8_t   saturation 
 Color saturation. More...
 
         uint8_t   sat 
 Color saturation. More...
 
         uint8_t   s 
 Color saturation. More...
 
      }  
 
      union { 
 
         uint8_t   value 
 Color value (brightness). More...
 
         uint8_t   val 
 Color value (brightness). More...
 
         uint8_t   v 
 Color value (brightness). More...
 
      }  
 
   }  
 
   uint8_t   raw [3] 
 Access the hue, saturation, and value data as an array. More...
 
};  
 

Constructor & Destructor Documentation

◆ CHSV() [1/2]

CHSV::CHSV ( )
inlinedefault

Default constructor.

Warning
Default values are UNITIALIZED!

◆ CHSV() [2/2]

CHSV::CHSV ( uint8_t  ih,
uint8_t  is,
uint8_t  iv 
)
inline

Allow construction from hue, saturation, and value.

Parameters
ihinput hue
isinput saturation
ivinput value

Definition at line 82 of file pixeltypes.h.

Member Function Documentation

◆ operator[]() [1/2]

uint8_t & CHSV::operator[] ( uint8_t  x)
inline

Array access operator to index into the CHSV object.

Parameters
xthe index to retrieve (0-2)
Returns
the CHSV::raw value for the given index

Definition at line 63 of file pixeltypes.h.

◆ operator[]() [2/2]

const uint8_t & CHSV::operator[] ( uint8_t  x) const
inline

Array access operator to index into the CHSV object.

Parameters
xthe index to retrieve (0-2)
Returns
the CHSV::raw value for the given index

Definition at line 69 of file pixeltypes.h.

◆ setHSV()

CHSV & CHSV::setHSV ( uint8_t  ih,
uint8_t  is,
uint8_t  iv 
)
inline

Assign new HSV values.

Parameters
ihinput hue
isinput saturation
ivinput value
Returns
reference to the CHSV object

Definition at line 98 of file pixeltypes.h.

Member Data Documentation

◆ h

uint8_t CHSV::h

Color hue.

This is an 8-bit value representing an angle around the color wheel. Where 0 is 0°, and 255 is 358°.

Definition at line 35 of file pixeltypes.h.

◆ hue

uint8_t CHSV::hue

Color hue.

This is an 8-bit value representing an angle around the color wheel. Where 0 is 0°, and 255 is 358°.

Definition at line 34 of file pixeltypes.h.

◆ raw

uint8_t CHSV::raw[3]

Access the hue, saturation, and value data as an array.

Where:

  • raw[0] is the hue
  • raw[1] is the saturation
  • raw[2] is the value

Definition at line 57 of file pixeltypes.h.

◆ s

uint8_t CHSV::s

Color saturation.

This is an 8-bit value representing a percentage.

Definition at line 42 of file pixeltypes.h.

◆ sat

uint8_t CHSV::sat

Color saturation.

This is an 8-bit value representing a percentage.

Definition at line 41 of file pixeltypes.h.

◆ saturation

uint8_t CHSV::saturation

Color saturation.

This is an 8-bit value representing a percentage.

Definition at line 40 of file pixeltypes.h.

◆ v

uint8_t CHSV::v

Color value (brightness).

This is an 8-bit value representing a percentage.

Definition at line 49 of file pixeltypes.h.

◆ val

uint8_t CHSV::val

Color value (brightness).

This is an 8-bit value representing a percentage.

Definition at line 48 of file pixeltypes.h.

◆ value

uint8_t CHSV::value

Color value (brightness).

This is an 8-bit value representing a percentage.

Definition at line 47 of file pixeltypes.h.


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