FastLED 3.10.6
Loading...
Searching...
No Matches

◆ component16()

fl::u16 fl::fled::VideoFrameView::component16 ( fl::size led,
fl::u8 component ) const
inline

Definition at line 48 of file fled.h.

48 {
49 if (!mPayload || mStorage.mFormat != fl::PixelFormat::Rgb16 ||
50 mStorage.mComponentByteOrder != ComponentByteOrder::LittleEndian ||
51 component >= 3 || led >= mPayloadBytes / 6) {
52 return 0;
53 }
54 const fl::size offset = led * 6 + static_cast<fl::size>(component) * 2;
55 if (offset >= mPayloadBytes - 1) {
56 return 0;
57 }
58 return static_cast<fl::u16>(mPayload.get()[offset]) |
59 (static_cast<fl::u16>(mPayload.get()[offset + 1]) << 8);
60 }
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
PixelStorage mStorage
Definition fled.h:40
fl::shared_ptr< const fl::u8 > mPayload
Definition fled.h:44
fl::size mPayloadBytes
Definition fled.h:45

References fl::FL_NO_EXCEPT, fl::fled::LittleEndian, mPayload, mPayloadBytes, mStorage, offset(), and fl::Rgb16.

+ Here is the call graph for this function: