| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * This file is part of the Falcon Player (FPP) and is Copyright (C) | ||
| 4 | * 2013-2022 by the Falcon Player Developers. | ||
| 5 | * | ||
| 6 | * The Falcon Player (FPP) is free software, and is covered under | ||
| 7 | * multiple Open Source licenses. Please see the included 'LICENSES' | ||
| 8 | * file for descriptions of what files are covered by each license. | ||
| 9 | * | ||
| 10 | * This source file is covered under the LGPL v2.1 as described in the | ||
| 11 | * included LICENSE.LGPL file. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <string> | ||
| 15 | |||
| 16 | class FPPColorOrder { | ||
| 17 | public: | ||
| 18 | enum Value { | ||
| 19 | kColorOrderRGB = 0, | ||
| 20 | kColorOrderRBG, | ||
| 21 | kColorOrderGRB, | ||
| 22 | kColorOrderGBR, | ||
| 23 | kColorOrderBRG, | ||
| 24 | kColorOrderBGR, | ||
| 25 | kColorOrderONE, | ||
| 26 | kColorOrderRGBW, | ||
| 27 | kColorOrderRBGW, | ||
| 28 | kColorOrderGRBW, | ||
| 29 | kColorOrderGBRW, | ||
| 30 | kColorOrderBRGW, | ||
| 31 | kColorOrderBGRW, | ||
| 32 | kColorOrderWRGB, | ||
| 33 | kColorOrderWRBG, | ||
| 34 | kColorOrderWGRB, | ||
| 35 | kColorOrderWGBR, | ||
| 36 | kColorOrderWBRG, | ||
| 37 | kColorOrderWBGR | ||
| 38 | }; | ||
| 39 | |||
| 40 | FPPColorOrder() = default; | ||
| 41 | 1513 | constexpr FPPColorOrder(Value order) : value(order) {} | |
| 42 | |||
| 43 | 918 | constexpr operator Value() const { return value; } | |
| 44 | explicit operator bool() const = delete; | ||
| 45 | |||
| 46 | constexpr bool operator==(FPPColorOrder a) const { return value == a.value; } | ||
| 47 | 272435 | constexpr bool operator==(Value a) const { return value == a; } | |
| 48 | constexpr bool operator!=(FPPColorOrder a) const { return value != a.value; } | ||
| 49 | constexpr bool operator!=(Value a) const { return value != a; } | ||
| 50 | |||
| 51 | int redOffset() const; | ||
| 52 | int greenOffset() const; | ||
| 53 | int blueOffset() const; | ||
| 54 | int whiteOffset() const; | ||
| 55 | |||
| 56 | int channelCount() const; | ||
| 57 | bool hasWhite() const; | ||
| 58 | |||
| 59 | private: | ||
| 60 | Value value; | ||
| 61 | }; | ||
| 62 | |||
| 63 | FPPColorOrder ColorOrderFromString(const std::string& colorOrderStr); | ||
| 64 | const std::string ColorOrderToString(const FPPColorOrder& colorOrder); | ||
| 65 |