FastLED 3.10.6
Loading...
Searching...
No Matches
pixel_format.h
Go to the documentation of this file.
1#pragma once
2
3// Public pixel-format boundary for .fled v1 containers. PixelFormat owns
4// stable serialized wire identifiers; fl::PixelFormat describes generic
5// storage and deliberately has a separate numeric domain.
6
7#include "fl/codec/pixel.h"
8#include "fl/stl/int.h"
9#include "fl/stl/noexcept.h"
10
11namespace fl {
12namespace fled {
13
14struct VideoColor;
15
16enum class PixelFormat : fl::u8 {
17 Rgb8 = 0x00, // 3 bpp - R, G, B
18 Gray8 = 0x01, // 1 bpp - Y
19 Rgba8 = 0x02, // 4 bpp - R, G, B, A
20 Rgbw8 = 0x03, // 4 bpp - R, G, B, W
21 Rgb565Le = 0x04, // 2 bpp - little-endian RGB565
22 Rgb16Linear = 0x05, // 6 bpp - R, G, B as u16le, linear light
23};
24
25// The component byte order travels with generic storage. In particular,
26// Rgb16 alone never authorizes treating FLED's u16le payload as native words.
32
37
38// Returns bytes per LED for a v1 pixel-format byte, or zero when the value is
39// unknown/reserved. Callers must reject zero before reading payload bytes.
41
42// Checked conversion between FLED's wire enum and generic storage. Only
43// direct RGB storage has a mapping today. The source color declaration is
44// resolved separately with resolveVideoColor() and must stay paired with this
45// descriptor through playback or serialization.
47bool toFledPixelFormat(const PixelStorage& storage, const VideoColor& color,
49
50} // namespace fled
51} // namespace fl
fl::u8 bytesPerLed(fl::u8 pixelFormat) FL_NO_EXCEPT
bool toFledPixelFormat(const PixelStorage &storage, const VideoColor &color, PixelFormat *out) FL_NO_EXCEPT
bool toPixelStorage(PixelFormat fledFormat, PixelStorage *out) FL_NO_EXCEPT
ComponentByteOrder mComponentByteOrder
fl::PixelFormat mFormat
unsigned char u8
Definition stdint.h:131
InputGamut g FL_NO_EXCEPT
Definition rgbw.h:121
PixelFormat
Definition pixel.h:7
Base definition for an LED controller.
Definition crgb.hpp:179