MythTV
master
|
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB. More...
#include <mythvideocolourspace.h>
Public Slots | |
int | ChangePictureAttribute (PictureAttribute Attribute, bool Direction, int Value) |
void | SetPrimariesMode (PrimariesMode Mode) |
void | RefreshState () |
Signals | |
void | Updated (bool PrimariesChanged) |
void | PictureAttributeChanged (PictureAttribute Attribute, int Value) |
void | SupportedAttributesChanged (PictureAttributeSupported Supported) |
void | PictureAttributesUpdated (const std::map< PictureAttribute, int > &Values) |
Public Member Functions | |
MythVideoColourSpace () | |
bool | UpdateColourSpace (const MythVideoFrame *Frame) |
Set the current colourspace to use. More... | |
PictureAttributeSupported | SupportedAttributes (void) const |
void | SetSupportedAttributes (PictureAttributeSupported Supported) |
Enable the given set of picture attributes. More... | |
int | GetPictureAttribute (PictureAttribute Attribute) |
void | SetAlpha (int Value) |
QMatrix4x4 | GetPrimaryMatrix (void) |
QStringList | GetColourMappingDefines (void) |
float | GetColourGamma (void) const |
float | GetDisplayGamma (void) const |
PrimariesMode | GetPrimariesMode (void) |
int | GetRange () const |
int | GetColourSpace () const |
![]() | |
ReferenceCounter (const QString &debugName, bool logDebug=true) | |
Creates reference counter with an initial value of 1. More... | |
virtual int | IncrRef (void) |
Increments reference count. More... | |
virtual int | DecrRef (void) |
Decrements reference count and deletes on 0. More... | |
Protected Member Functions | |
~MythVideoColourSpace () override | |
![]() | |
virtual | ~ReferenceCounter (void) |
Called on destruction, will warn if object deleted with references in place. More... | |
Private Member Functions | |
void | SetFullRange (bool FullRange) |
void | SetBrightness (int Value) |
void | SetContrast (int Value) |
void | SetHue (int Value) |
void | SetSaturation (int Value) |
void | SaveValue (PictureAttribute Attribute, int Value) |
Save the PictureAttribute value to the database. More... | |
void | Update (void) |
Update the matrix for the current settings and colourspace. More... | |
void | Debug (void) |
QMatrix4x4 | GetPrimaryConversion (int Source, int Dest) |
Static Private Member Functions | |
static MythColourSpace | GetPrimaries (int Primary, float &Gamma) |
Private Attributes | |
PictureAttributeSupported | m_supportedAttributes { kPictureAttributeSupported_None } |
std::map< PictureAttribute, int > | m_dbSettings |
bool | m_fullRange { true } |
float | m_brightness { 0.0F } |
float | m_contrast { 1.0F } |
float | m_saturation { 1.0F } |
float | m_hue { 0.0F } |
float | m_alpha { 1.0F } |
int | m_colourSpace { AVCOL_SPC_UNSPECIFIED } |
int | m_colourSpaceDepth { 8 } |
int | m_range { AVCOL_RANGE_MPEG } |
bool | m_updatesDisabled { true } |
bool | m_colourShifted { false } |
int | m_colourTransfer { AVCOL_TRC_BT709 } |
PrimariesMode | m_primariesMode { PrimariesRelaxed } |
int | m_colourPrimaries { AVCOL_PRI_BT709 } |
int | m_displayPrimaries { AVCOL_PRI_BT709 } |
int | m_chromaLocation { AVCHROMA_LOC_LEFT } |
float | m_colourGamma { 2.2F } |
float | m_displayGamma { 2.2F } |
QMatrix4x4 | m_primaryMatrix { } |
float | m_customDisplayGamma { 0.0F } |
MythColourSpace * | m_customDisplayPrimaries { nullptr } |
Friends | |
class | MythVideoOutput |
Additional Inherited Members | |
![]() | |
static void | PrintDebug (void) |
Print out any leaks if that level of debugging is enabled. More... | |
![]() | |
bool | m_logDebug |
This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More... | |
QAtomicInt | m_referenceCount {1} |
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
A 4x4 matrix is created that is customised for the source colourspace and user defined adjustments for brightness, contrast, hue, saturation (colour) and 'levels'.
An alpha value is also added for rendering purposes. This assumes the raw data is in the form YCbCrA.
Levels are expanded to the full RGB colourspace range by default but enabling studio levels will ensure there is no adjustment. In both cases it is assumed the display device is setup appropriately.
Definition at line 18 of file mythvideocolourspace.h.
MythVideoColourSpace::MythVideoColourSpace | ( | ) |
Definition at line 40 of file mythvideocolourspace.cpp.
|
overrideprotected |
Definition at line 90 of file mythvideocolourspace.cpp.
|
slot |
Definition at line 266 of file mythvideocolourspace.cpp.
Referenced by MythVideoOutputGPU::MythVideoOutputGPU().
|
slot |
Definition at line 490 of file mythvideocolourspace.cpp.
|
slot |
Definition at line 95 of file mythvideocolourspace.cpp.
Referenced by MythVideoOutputGPU::MythVideoOutputGPU().
|
signal |
|
signal |
|
signal |
Referenced by MythVideoOutputGPU::MythVideoOutputGPU(), RefreshState(), and SetSupportedAttributes().
|
signal |
Referenced by MythVideoOutputGPU::MythVideoOutputGPU(), and RefreshState().
bool MythVideoColourSpace::UpdateColourSpace | ( | const MythVideoFrame * | Frame | ) |
Set the current colourspace to use.
We rely on FFmpeg to detect and report the correct colourspace. In the event that no colourspace is found we use sensible defaults for standard and high definition content (BT470BG/BT601 and BT709 respectively).
Definition at line 321 of file mythvideocolourspace.cpp.
Referenced by MythMMALInterop::Acquire(), MythDRMPRIMEInterop::Acquire(), MythVAAPIInteropDRM::Acquire(), MythMediaCodecInterop::Acquire(), MythNVDECInterop::Acquire(), MythVDPAUInterop::Acquire(), MythVideoVulkan::PrepareFrame(), MythOpenGLVideo::PrepareFrame(), and MythVTBInterop::Verify().
PictureAttributeSupported MythVideoColourSpace::SupportedAttributes | ( | void | ) | const |
Definition at line 101 of file mythvideocolourspace.cpp.
Referenced by MythVideoOutput::GetSupportedPictureAttributes().
void MythVideoColourSpace::SetSupportedAttributes | ( | PictureAttributeSupported | Supported | ) |
Enable the given set of picture attributes.
This is determined by the video rendering classes and is usually dependant upon the rendering method in use and type of video frame (e.g. hardware decoded or not).
Definition at line 111 of file mythvideocolourspace.cpp.
Referenced by MythMMALInterop::Acquire(), MythVAAPIInteropDRM::Acquire(), MythDRMPRIMEInterop::Acquire(), MythMediaCodecInterop::Acquire(), MythNVDECInterop::Acquire(), MythVDPAUInterop::Acquire(), MythVAAPIInteropGLX::InitPictureAttributes(), MythVideoOutputGPU::InitPictureAttributes(), MythVideoDRM::MythVideoDRM(), and MythVTBInterop::Verify().
int MythVideoColourSpace::GetPictureAttribute | ( | PictureAttribute | Attribute | ) |
Definition at line 120 of file mythvideocolourspace.cpp.
Referenced by ChangePictureAttribute(), and MythVAAPIInteropGLX::InitPictureAttributes().
void MythVideoColourSpace::SetAlpha | ( | int | Value | ) |
Definition at line 436 of file mythvideocolourspace.cpp.
QMatrix4x4 MythVideoColourSpace::GetPrimaryMatrix | ( | void | ) |
Definition at line 460 of file mythvideocolourspace.cpp.
Referenced by MythOpenGLVideo::ColourSpaceUpdate(), and MythOpenGLTonemap::UpdateColourSpace().
QStringList MythVideoColourSpace::GetColourMappingDefines | ( | void | ) |
Definition at line 442 of file mythvideocolourspace.cpp.
Referenced by MythOpenGLVideo::CreateVideoShader().
float MythVideoColourSpace::GetColourGamma | ( | void | ) | const |
Definition at line 465 of file mythvideocolourspace.cpp.
Referenced by MythOpenGLVideo::ColourSpaceUpdate().
float MythVideoColourSpace::GetDisplayGamma | ( | void | ) | const |
Definition at line 470 of file mythvideocolourspace.cpp.
Referenced by MythOpenGLVideo::ColourSpaceUpdate().
PrimariesMode MythVideoColourSpace::GetPrimariesMode | ( | void | ) |
Definition at line 475 of file mythvideocolourspace.cpp.
int MythVideoColourSpace::GetRange | ( | ) | const |
Definition at line 480 of file mythvideocolourspace.cpp.
Referenced by MythVideoDRM::ColourSpaceUpdated().
int MythVideoColourSpace::GetColourSpace | ( | ) | const |
Definition at line 485 of file mythvideocolourspace.cpp.
Referenced by MythVideoDRM::ColourSpaceUpdated().
|
private |
Definition at line 406 of file mythvideocolourspace.cpp.
Referenced by MythVideoColourSpace().
|
private |
Definition at line 412 of file mythvideocolourspace.cpp.
Referenced by ChangePictureAttribute(), and MythVideoColourSpace().
|
private |
Definition at line 418 of file mythvideocolourspace.cpp.
Referenced by ChangePictureAttribute(), and MythVideoColourSpace().
|
private |
Definition at line 424 of file mythvideocolourspace.cpp.
Referenced by ChangePictureAttribute(), and MythVideoColourSpace().
|
private |
Definition at line 430 of file mythvideocolourspace.cpp.
Referenced by ChangePictureAttribute(), and MythVideoColourSpace().
|
private |
Save the PictureAttribute value to the database.
Definition at line 497 of file mythvideocolourspace.cpp.
Referenced by ChangePictureAttribute().
|
private |
Update the matrix for the current settings and colourspace.
The matrix is built from first principles to help with maintainability. This is an expensive task but it is only recalculated when a change is detected or notified.
Definition at line 133 of file mythvideocolourspace.cpp.
Referenced by MythVideoColourSpace(), SetAlpha(), SetBrightness(), SetContrast(), SetFullRange(), SetHue(), SetPrimariesMode(), SetSaturation(), and UpdateColourSpace().
|
private |
Definition at line 241 of file mythvideocolourspace.cpp.
Referenced by Update().
|
private |
Definition at line 515 of file mythvideocolourspace.cpp.
Referenced by Update().
|
staticprivate |
Definition at line 552 of file mythvideocolourspace.cpp.
Referenced by GetPrimaryConversion().
|
friend |
Definition at line 22 of file mythvideocolourspace.h.
|
private |
Definition at line 66 of file mythvideocolourspace.h.
Referenced by ChangePictureAttribute(), RefreshState(), SetSupportedAttributes(), and SupportedAttributes().
|
private |
Definition at line 67 of file mythvideocolourspace.h.
Referenced by GetPictureAttribute(), MythVideoColourSpace(), RefreshState(), and SaveValue().
Definition at line 69 of file mythvideocolourspace.h.
Referenced by Debug(), SetFullRange(), Update(), and UpdateColourSpace().
|
private |
Definition at line 70 of file mythvideocolourspace.h.
Referenced by Debug(), SetBrightness(), and Update().
|
private |
Definition at line 71 of file mythvideocolourspace.h.
Referenced by Debug(), SetContrast(), and Update().
|
private |
Definition at line 72 of file mythvideocolourspace.h.
Referenced by Debug(), SetSaturation(), and Update().
|
private |
Definition at line 73 of file mythvideocolourspace.h.
|
private |
Definition at line 74 of file mythvideocolourspace.h.
Referenced by Debug(), SetAlpha(), and Update().
|
private |
Definition at line 75 of file mythvideocolourspace.h.
Referenced by GetColourSpace(), Update(), and UpdateColourSpace().
|
private |
Definition at line 76 of file mythvideocolourspace.h.
Referenced by Update(), and UpdateColourSpace().
|
private |
Definition at line 77 of file mythvideocolourspace.h.
Referenced by GetRange(), Update(), and UpdateColourSpace().
Definition at line 78 of file mythvideocolourspace.h.
Referenced by MythVideoColourSpace(), and Update().
Definition at line 79 of file mythvideocolourspace.h.
Referenced by Update(), and UpdateColourSpace().
|
private |
Definition at line 80 of file mythvideocolourspace.h.
Referenced by UpdateColourSpace().
|
private |
Definition at line 81 of file mythvideocolourspace.h.
Referenced by GetPrimariesMode(), GetPrimaryConversion(), MythVideoColourSpace(), and SetPrimariesMode().
|
private |
Definition at line 82 of file mythvideocolourspace.h.
Referenced by Update(), and UpdateColourSpace().
|
private |
Definition at line 83 of file mythvideocolourspace.h.
Referenced by Update(), and UpdateColourSpace().
|
private |
Definition at line 84 of file mythvideocolourspace.h.
Referenced by GetColourMappingDefines(), and UpdateColourSpace().
|
private |
Definition at line 85 of file mythvideocolourspace.h.
Referenced by GetColourGamma(), GetPrimaryConversion(), and Update().
|
private |
Definition at line 86 of file mythvideocolourspace.h.
Referenced by GetDisplayGamma(), GetPrimaryConversion(), and Update().
|
private |
Definition at line 87 of file mythvideocolourspace.h.
Referenced by Debug(), GetColourMappingDefines(), GetPrimaryMatrix(), Update(), and UpdateColourSpace().
|
private |
Definition at line 88 of file mythvideocolourspace.h.
Referenced by GetPrimaryConversion().
|
private |
Definition at line 89 of file mythvideocolourspace.h.
Referenced by GetPrimaryConversion(), UpdateColourSpace(), and ~MythVideoColourSpace().