Skip to content

Commit

Permalink
Merge branch 'feature/reworkStatisticsType' of github.com:IENT/YUView…
Browse files Browse the repository at this point in the history
… into feature/reworkStatisticsType
  • Loading branch information
ChristianFeldmann committed Jan 11, 2025
2 parents cf7650b + 2defa85 commit c2b3392
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion YUViewLib/src/decoder/decoderHM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ void decoderHM::fillStatisticList(stats::StatisticsData &statisticsData) const
.withValueDataOptions(StatisticsType::ValueDataOptions(
{.colorMapper = ColorMapper({0, 34}, PredefinedType::Jet)}))
.withVectorDataOptions(
StatisticsType::VectorDataOptions({.scale = 32, .renderDataValues = true}))
StatisticsType::VectorDataOptions({.renderDataValues = true, .scale = 32}))
.withMappingValues(
{"INTRA_PLANAR", "INTRA_DC", "INTRA_ANGULAR_2", "INTRA_ANGULAR_3",
"INTRA_ANGULAR_4", "INTRA_ANGULAR_5", "INTRA_ANGULAR_6", "INTRA_ANGULAR_7",
Expand Down
4 changes: 2 additions & 2 deletions YUViewLib/src/decoder/decoderLibde265.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ void decoderLibde265::fillStatisticList(stats::StatisticsData &statisticsData) c
.withDescription("The intra mode for the luma component per TU (intra prediction is "
"performed on a TU level)")
.withVectorDataOptions(
StatisticsType::VectorDataOptions({.scale = 32, .renderDataValues = false}))
StatisticsType::VectorDataOptions({.renderDataValues = false, .scale = 32}))
.withMappingValues(INTRA_DIR_LIST)
.build());

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

Expand Down
10 changes: 5 additions & 5 deletions YUViewLib/src/statistics/StatisticsFileCSV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ void StatisticsFileCSV::loadStatisticData(StatisticsData &statisticsData, int po
this->blockOutsideOfFramePOC = poc;

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

if (vectorData && statIt->vectorDataOptions)
Expand Down Expand Up @@ -398,11 +398,11 @@ void StatisticsFileCSV::readHeaderFromFile(StatisticsData &statisticsData)
{
if (rowItemList[4] == "map" || rowItemList[4] == "range")
{
aType.valueDataOptions.emplace();
aType.valueDataOptions = StatisticsType::ValueDataOptions();
}
else if (rowItemList[4] == "vector" || rowItemList[4] == "line")
{
aType.vectorDataOptions.emplace();
aType.vectorDataOptions = StatisticsType::VectorDataOptions();
if (rowItemList[4] == "line")
aType.vectorDataOptions->arrowHead = StatisticsType::ArrowHead::none;
}
Expand Down
6 changes: 3 additions & 3 deletions YUViewLib/src/statistics/StatisticsType.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class StatisticsType
{
bool render{true};
bool scaleToBlockSize{};
color::ColorMapper colorMapper;
color::ColorMapper colorMapper{};
};

std::optional<ValueDataOptions> valueDataOptions;
Expand All @@ -118,7 +118,7 @@ class StatisticsType
bool render{true};
bool renderDataValues{true};
bool scaleToZoom{};
LineDrawStyle style;
LineDrawStyle style{};
int scale{};
bool mapToColor{};
ArrowHead arrowHead{};
Expand All @@ -129,7 +129,7 @@ class StatisticsType
struct GridOptions
{
bool render{};
LineDrawStyle style;
LineDrawStyle style{};
bool scaleToZoom{};
};

Expand Down
2 changes: 2 additions & 0 deletions YUViewUnitTest/statistics/StatisticsDataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ TEST(StatisticsData, testPixelValueRetrievalInteger)
.withTypeName("Something")
.withValueDataOptions({.colorMapper = stats::color::ColorMapper(
{0, 10}, stats::color::PredefinedType::Jet)})
.withRender(true)
.build());

EXPECT_EQ(data.needsLoading(frameIndex), ItemLoadingState::LoadingNeeded);
Expand Down Expand Up @@ -80,6 +81,7 @@ TEST(StatisticsData, testPixelValueRetrievalVector)
.withTypeID(typeID)
.withTypeName("Something")
.withVectorDataOptions({.scale = 4})
.withRender(true)
.build());

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

0 comments on commit c2b3392

Please sign in to comment.