| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file is part of the Falcon Player (FPP) and is Copyright (C) | ||
| 3 | * 2013-2022 by the Falcon Player Developers. | ||
| 4 | * | ||
| 5 | * The Falcon Player (FPP) is free software, and is covered under | ||
| 6 | * multiple Open Source licenses. Please see the included 'LICENSES' | ||
| 7 | * file for descriptions of what files are covered by each license. | ||
| 8 | * | ||
| 9 | * This source file is covered under the LGPL v2.1 as described in the | ||
| 10 | * included LICENSE.LGPL file. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include "fpp-pch.h" | ||
| 14 | |||
| 15 | #include "fpp-json.h" | ||
| 16 | |||
| 17 | #include "../../log.h" | ||
| 18 | |||
| 19 | #include "ColorOrderOutputProcessor.h" | ||
| 20 | |||
| 21 | 3 | ColorOrderOutputProcessor::ColorOrderOutputProcessor(const Json::Value& config) { | |
| 22 |
2/4✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
|
3 | description = config["description"].asString(); |
| 23 |
2/4✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
|
3 | active = config["active"].asInt() ? true : false; |
| 24 |
2/4✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
|
3 | start = config["start"].asInt(); |
| 25 |
2/4✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
|
3 | count = config["count"].asInt(); |
| 26 |
2/4✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
|
3 | order = config["colorOrder"].asInt(); |
| 27 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | ProcessModelConfig(config, model, start, count); |
| 28 | |||
| 29 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | LogInfo(VB_CHANNELOUT, "Color Order: %d-%d => %d, Model: %s\n", |
| 30 | start + 1, start + (count * 3), | ||
| 31 | order, model.c_str()); | ||
| 32 | 3 | } | |
| 33 | |||
| 34 | ✗ | ColorOrderOutputProcessor::~ColorOrderOutputProcessor() { | |
| 35 | ✗ | } | |
| 36 | |||
| 37 | 30 | void ColorOrderOutputProcessor::ProcessData(unsigned char* channelData) const { | |
| 38 | 30 | int cur = start; | |
| 39 |
2/2✓ Branch 0 taken 225 times.
✓ Branch 1 taken 30 times.
|
255 | for (int x = 0; x < count; x++, cur += 3) { |
| 40 | 225 | int a = channelData[cur]; | |
| 41 | 225 | int b = channelData[cur + 1]; | |
| 42 | 225 | int c = channelData[cur + 2]; | |
| 43 |
2/6✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 75 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 150 times.
✗ Branch 5 not taken.
|
225 | switch (order) { |
| 44 | ✗ | case 132: | |
| 45 | ✗ | channelData[cur + 1] = c; | |
| 46 | ✗ | channelData[cur + 2] = b; | |
| 47 | ✗ | break; | |
| 48 | ✗ | case 213: | |
| 49 | ✗ | channelData[cur] = b; | |
| 50 | ✗ | channelData[cur + 1] = a; | |
| 51 | ✗ | break; | |
| 52 | 75 | case 231: | |
| 53 | 75 | channelData[cur] = b; | |
| 54 | 75 | channelData[cur + 1] = c; | |
| 55 | 75 | channelData[cur + 2] = a; | |
| 56 | 75 | break; | |
| 57 | ✗ | case 312: | |
| 58 | ✗ | channelData[cur] = c; | |
| 59 | ✗ | channelData[cur + 1] = a; | |
| 60 | ✗ | channelData[cur + 2] = b; | |
| 61 | ✗ | break; | |
| 62 | 150 | case 321: | |
| 63 | 150 | channelData[cur] = c; | |
| 64 | 150 | channelData[cur + 2] = a; | |
| 65 | 150 | break; | |
| 66 | } | ||
| 67 | } | ||
| 68 | 30 | } | |
| 69 |