Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
60a2bc2a
Commit
60a2bc2a
authored
Jul 21, 2022
by
Eric Jiang
Committed by
Jean-Baptiste Mardelle
Jul 25, 2022
Browse files
Test waveform RGB/BGR handling
parent
3f810507
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/colorscopestest.cpp
View file @
60a2bc2a
#include
"test_utils.hpp"
#include
"scopes/colorscopes/colorconstants.h"
#include
"scopes/colorscopes/vectorscopegenerator.h"
#include
"scopes/colorscopes/waveformgenerator.h"
TEST_CASE
(
"Vectorscope"
)
// 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
// Multiple scopes are affected, including vectorscope and waveform
TEST_CASE
(
"Colorscope RGB/BGR handling"
)
{
// create a fully red image
QImage
inputImage
(
480
,
320
,
QImage
::
Format_RGB32
);
inputImage
.
fill
(
Qt
::
red
);
VectorscopeGenerator
vectorscope
{}
;
QImage
bgrInputImage
=
inputImage
.
convertToFormat
(
QImage
::
Format_BGR30
)
;
QSize
scopeSize
{
256
,
256
};
// 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
SECTION
(
"Vectorscope handles both RGB and BGR"
)
{
VectorscopeGenerator
vectorscope
{};
QImage
rgbScope
=
vectorscope
.
calculateVectorscope
(
scopeSize
,
inputImage
,
1
,
VectorscopeGenerator
::
PaintMode
::
PaintMode_Green2
,
VectorscopeGenerator
::
ColorSpace
::
ColorSpace_YUV
,
false
,
7
);
QImage
bgrInputImage
=
inputImage
.
convertToFormat
(
QImage
::
Format_BGR30
);
QImage
bgrScope
=
vectorscope
.
calculateVectorscope
(
scopeSize
,
bgrInputImage
,
1
,
VectorscopeGenerator
::
PaintMode
::
PaintMode_Green2
,
VectorscopeGenerator
::
ColorSpace
::
ColorSpace_YUV
,
...
...
@@ -30,4 +32,17 @@ TEST_CASE("Vectorscope")
// handle different pixel formats
CHECK
(
rgbScope
==
bgrScope
);
}
SECTION
(
"Waveform handles both RGB and BGR"
)
{
WaveformGenerator
waveform
{};
QImage
rgbScope
=
waveform
.
calculateWaveform
(
scopeSize
,
inputImage
,
WaveformGenerator
::
PaintMode
::
PaintMode_Yellow
,
false
,
ITURec
::
Rec_709
,
1
);
QImage
bgrScope
=
waveform
.
calculateWaveform
(
scopeSize
,
bgrInputImage
,
WaveformGenerator
::
PaintMode
::
PaintMode_Yellow
,
false
,
ITURec
::
Rec_709
,
1
);
CHECK
(
rgbScope
==
bgrScope
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment