Skip to content

Commit

Permalink
Switch ComponentDisplayModeMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Jul 22, 2024
1 parent 64aeb0c commit 79a01ea
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions YUViewLib/src/video/yuv/videoHandlerYUV.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#pragma once

#include <common/NewEnumMapper.h>
#include <video/videoHandler.h>
#include <video/yuv/PixelFormatYUV.h>

Expand All @@ -55,11 +56,11 @@ enum class ComponentDisplayMode
DisplayCr
};

const auto ComponentDisplayModeMapper =
EnumMapper<ComponentDisplayMode>({{ComponentDisplayMode::DisplayAll, "Y'CbCr"},
{ComponentDisplayMode::DisplayY, "Luma (Y) Only"},
{ComponentDisplayMode::DisplayCb, "Cb only"},
{ComponentDisplayMode::DisplayCr, "Cr only"}});
const NewEnumMapper<ComponentDisplayMode, 4>
ComponentDisplayModeMapper(std::make_pair(ComponentDisplayMode::DisplayAll, "Y'CbCr"sv),
std::make_pair(ComponentDisplayMode::DisplayY, "Luma (Y) Only"sv),
std::make_pair(ComponentDisplayMode::DisplayCb, "Cb only"sv),
std::make_pair(ComponentDisplayMode::DisplayCr, "Cr only"sv));

struct ConversionSettings
{
Expand Down Expand Up @@ -110,7 +111,7 @@ class videoHandlerYUV : public videoHandler
// to another playlistItemVideo. If item2 cannot be converted to a playlistItemYuvSource,
// we will use the playlistItemVideo::calculateDifference function to calculate the difference
// using the RGB values.
virtual QImage calculateDifference(FrameHandler * item2,
virtual QImage calculateDifference(FrameHandler *item2,
const int frameIdxItem0,
const int frameIdxItem1,
QList<InfoItem> &differenceInfoList,
Expand Down Expand Up @@ -169,9 +170,9 @@ class videoHandlerYUV : public videoHandler
// Draw the pixel values of the visible pixels in the center of each pixel. Only draw values for
// the given range of pixels. Overridden from playlistItemVideo. This is a YUV source, so we can
// draw the YUV values.
virtual void drawPixelValues(QPainter * painter,
virtual void drawPixelValues(QPainter *painter,
const int frameIdx,
const QRect & videoRect,
const QRect &videoRect,
const double zoomFactor,
FrameHandler *item2 = nullptr,
const bool markDifference = false,
Expand Down Expand Up @@ -222,8 +223,8 @@ class videoHandlerYUV : public videoHandler
bool setFormatFromSizeAndNamePacked(
QString name, const Size size, int bitDepth, Subsampling subsampling, int64_t fileSize);

bool markDifferencesYUVPlanarToRGB(const QByteArray & sourceBuffer,
unsigned char * targetBuffer,
bool markDifferencesYUVPlanarToRGB(const QByteArray &sourceBuffer,
unsigned char *targetBuffer,
const Size frameSize,
const PixelFormatYUV &sourceBufferFormat) const;

Expand Down

0 comments on commit 79a01ea

Please sign in to comment.