Skip to content

Commit c2b3392

Browse files
Merge branch 'feature/reworkStatisticsType' of github.com:IENT/YUView into feature/reworkStatisticsType
2 parents cf7650b + 2defa85 commit c2b3392

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

YUViewLib/src/decoder/decoderHM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ void decoderHM::fillStatisticList(stats::StatisticsData &statisticsData) const
566566
.withValueDataOptions(StatisticsType::ValueDataOptions(
567567
{.colorMapper = ColorMapper({0, 34}, PredefinedType::Jet)}))
568568
.withVectorDataOptions(
569-
StatisticsType::VectorDataOptions({.scale = 32, .renderDataValues = true}))
569+
StatisticsType::VectorDataOptions({.renderDataValues = true, .scale = 32}))
570570
.withMappingValues(
571571
{"INTRA_PLANAR", "INTRA_DC", "INTRA_ANGULAR_2", "INTRA_ANGULAR_3",
572572
"INTRA_ANGULAR_4", "INTRA_ANGULAR_5", "INTRA_ANGULAR_6", "INTRA_ANGULAR_7",

YUViewLib/src/decoder/decoderLibde265.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ void decoderLibde265::fillStatisticList(stats::StatisticsData &statisticsData) c
10021002
.withDescription("The intra mode for the luma component per TU (intra prediction is "
10031003
"performed on a TU level)")
10041004
.withVectorDataOptions(
1005-
StatisticsType::VectorDataOptions({.scale = 32, .renderDataValues = false}))
1005+
StatisticsType::VectorDataOptions({.renderDataValues = false, .scale = 32}))
10061006
.withMappingValues(INTRA_DIR_LIST)
10071007
.build());
10081008

@@ -1013,7 +1013,7 @@ void decoderLibde265::fillStatisticList(stats::StatisticsData &statisticsData) c
10131013
.withDescription("The intra mode for the chroma component per TU (intra prediction is "
10141014
"performed on a TU level)")
10151015
.withVectorDataOptions(
1016-
StatisticsType::VectorDataOptions({.scale = 32, .renderDataValues = false}))
1016+
StatisticsType::VectorDataOptions({.renderDataValues = false, .scale = 32}))
10171017
.withMappingValues(INTRA_DIR_LIST)
10181018
.build());
10191019

YUViewLib/src/statistics/StatisticsFileCSV.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ void StatisticsFileCSV::loadStatisticData(StatisticsData &statisticsData, int po
315315
this->blockOutsideOfFramePOC = poc;
316316

317317
auto &statTypes = statisticsData.getStatisticsTypes();
318-
auto statIt = std::find_if(statTypes.begin(),
319-
statTypes.end(),
320-
[type](StatisticsType &t) { return t.typeID == type; });
318+
auto statIt = std::find_if(statTypes.begin(), statTypes.end(), [type](StatisticsType &t) {
319+
return t.typeID == type;
320+
});
321321
Q_ASSERT_X(statIt != statTypes.end(), Q_FUNC_INFO, "Stat type not found.");
322322

323323
if (vectorData && statIt->vectorDataOptions)
@@ -398,11 +398,11 @@ void StatisticsFileCSV::readHeaderFromFile(StatisticsData &statisticsData)
398398
{
399399
if (rowItemList[4] == "map" || rowItemList[4] == "range")
400400
{
401-
aType.valueDataOptions.emplace();
401+
aType.valueDataOptions = StatisticsType::ValueDataOptions();
402402
}
403403
else if (rowItemList[4] == "vector" || rowItemList[4] == "line")
404404
{
405-
aType.vectorDataOptions.emplace();
405+
aType.vectorDataOptions = StatisticsType::VectorDataOptions();
406406
if (rowItemList[4] == "line")
407407
aType.vectorDataOptions->arrowHead = StatisticsType::ArrowHead::none;
408408
}

YUViewLib/src/statistics/StatisticsType.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class StatisticsType
101101
{
102102
bool render{true};
103103
bool scaleToBlockSize{};
104-
color::ColorMapper colorMapper;
104+
color::ColorMapper colorMapper{};
105105
};
106106

107107
std::optional<ValueDataOptions> valueDataOptions;
@@ -118,7 +118,7 @@ class StatisticsType
118118
bool render{true};
119119
bool renderDataValues{true};
120120
bool scaleToZoom{};
121-
LineDrawStyle style;
121+
LineDrawStyle style{};
122122
int scale{};
123123
bool mapToColor{};
124124
ArrowHead arrowHead{};
@@ -129,7 +129,7 @@ class StatisticsType
129129
struct GridOptions
130130
{
131131
bool render{};
132-
LineDrawStyle style;
132+
LineDrawStyle style{};
133133
bool scaleToZoom{};
134134
};
135135

YUViewUnitTest/statistics/StatisticsDataTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ TEST(StatisticsData, testPixelValueRetrievalInteger)
5050
.withTypeName("Something")
5151
.withValueDataOptions({.colorMapper = stats::color::ColorMapper(
5252
{0, 10}, stats::color::PredefinedType::Jet)})
53+
.withRender(true)
5354
.build());
5455

5556
EXPECT_EQ(data.needsLoading(frameIndex), ItemLoadingState::LoadingNeeded);
@@ -80,6 +81,7 @@ TEST(StatisticsData, testPixelValueRetrievalVector)
8081
.withTypeID(typeID)
8182
.withTypeName("Something")
8283
.withVectorDataOptions({.scale = 4})
84+
.withRender(true)
8385
.build());
8486

8587
EXPECT_EQ(data.needsLoading(frameIndex), ItemLoadingState::LoadingNeeded);

0 commit comments

Comments
 (0)