Commit 3a146b81 authored by Eric Jiang's avatar Eric Jiang Committed by Jean-Baptiste Mardelle
Browse files

Test histogram handling RGB/BGR

Histogram didn't have the red/blue switch bug to begin with.
parent 4157005e
Pipeline #208799 passed with stage
in 9 minutes and 16 seconds
......@@ -4,6 +4,7 @@
#include "scopes/colorscopes/vectorscopegenerator.h"
#include "scopes/colorscopes/waveformgenerator.h"
#include "scopes/colorscopes/rgbparadegenerator.h"
#include "scopes/colorscopes/histogramgenerator.h"
// test for a bug where pixels were assumed to be RGB which was not true on
// Windows, resulting in red and blue switched. BUG: 453149
......@@ -59,4 +60,19 @@ TEST_CASE("Colorscope RGB/BGR handling")
CHECK(rgbScope == bgrScope);
SECTION("Histogram handles both RGB and BGR")
const auto ALL_COMPONENTS = HistogramGenerator::Components::ComponentR |
HistogramGenerator::Components::ComponentG |
HistogramGenerator hist{};
QImage rgbScope = hist.calculateHistogram(scopeSize, inputImage,
ALL_COMPONENTS, ITURec::Rec_709, false, false, 3);
QImage bgrScope = hist.calculateHistogram(scopeSize, bgrInputImage,
ALL_COMPONENTS, ITURec::Rec_709, false, false, 3);
CHECK(rgbScope == bgrScope);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment