M5Unit-COLOR 0.1.1 git rev:9de2836
Loading...
Searching...
No Matches
m5::unit::tcs3472x::Data Struct Reference

Measurement data group. More...

#include <unit_TCS3472x.hpp>

Public Member Functions

int32_t IR (bool usingCache=true) const
 Gets the IR component.
 
Raw value
uint16_t R16 () const
 Gets the raw red value.
 
uint16_t G16 () const
 Gets the raw green value.
 
uint16_t B16 () const
 Gets the raw blue value.
 
uint16_t C16 () const
 Gets the raw clear value.
 
uint16_t RnoIR16 () const
 Gets the raw red value without IR component.
 
uint16_t GnoIR16 () const
 Gets the raw green value without IR component.
 
uint16_t BnoIR16 () const
 Gets the raw blue value without IR component.
 
uint16_t CnoIR16 () const
 Gets the raw clear value without IR component.
 
RGB
uint8_t R8 () const
 Gets the red value (0-255)
 
uint8_t G8 () const
 Gets the green value (0-255)
 
uint8_t B8 () const
 Gets the blue value (0-255)
 
uint8_t RnoIR8 () const
 Gets the red value without IR component (0-255)
 
uint8_t GnoIR8 () const
 Gets the green value without IR component (0-255)
 
uint8_t BnoIR8 () const
 Gets the blue value without IR component (0-255)
 
uint16_t RGB565 () const
 Gets the value in RGB565 format.
 
uint32_t RGB888 () const
 Gets the value in RGB888 format.
 
uint16_t RGBnoIR565 () const
 Gets the value in RGB565 format without IR component.
 
uint32_t RGBnoIR888 () const
 Gets the value in RGB888 format without IR component.
 

Static Public Member Functions

static uint8_t raw_to_uint8 (const int32_t v, const int32_t c)
 Raw to uint8_t.
 
Conversion (Same as M5GFX)
static constexpr uint8_t color332 (uint8_t r, uint8_t g, uint8_t b)
 Converts 8-bit RGB channels to RGB332 format.
 
static constexpr uint16_t color565 (uint8_t r, uint8_t g, uint8_t b)
 Converts 8-bit RGB channels to RGB565 format.
 
static constexpr uint32_t color888 (uint8_t r, uint8_t g, uint8_t b)
 Converts 8-bit RGB channels to RGB888 format.
 
static constexpr uint16_t swap565 (uint8_t r, uint8_t g, uint8_t b)
 Converts 8-bit RGB channels to byte-swapped RGB565 format.
 
static constexpr uint32_t swap888 (uint8_t r, uint8_t g, uint8_t b)
 Converts 8-bit RGB channels to byte-swapped RGB888 format.
 

Public Attributes

std::array< uint8_t, 8 > raw {}
 Raw data ClCh/RlRh/GlGh/BlBh.
 

Detailed Description

Measurement data group.

Member Function Documentation

◆ IR()

int32_t m5::unit::tcs3472x::Data::IR ( bool usingCache = true) const
inline

Gets the IR component.

Parameters
usingCacheIf true, use cached value when available
Returns
IR component value

◆ raw_to_uint8()

static uint8_t m5::unit::tcs3472x::Data::raw_to_uint8 ( const int32_t v,
const int32_t c )
inlinestatic

Raw to uint8_t.

Parameters
vRaw channel value
cRaw clear channel value
Returns
Scaled uint8_t value