11 #include "ConversionMatrix.h" 12 #include "GLSLOutput.h" 13 #include "ShaderFormats.h" 14 #include "cores/VideoSettings.h" 15 #include "guilib/Shader.h" 16 #include "utils/TransformMatrix.h" 21 #include <libavutil/pixfmt.h> 22 #include <libavutil/mastering_display_metadata.h> 40 ETONEMAPMETHOD toneMapMethod,
41 std::shared_ptr<GLSLOutput> output);
44 void SetField(
int field) { m_field = field; }
45 void SetWidth(
int w) { m_width = w; }
46 void SetHeight(
int h) { m_height = h; }
48 void SetColParams(AVColorSpace colSpace,
int bits,
bool limited,
int textureBits);
49 void SetBlack(
float black) { m_black = black; }
50 void SetContrast(
float contrast) { m_contrast = contrast; }
51 void SetNonLinStretch(
float stretch) { m_stretch = stretch; }
52 void SetDisplayMetadata(
bool hasDisplayMetadata,
53 const AVMasteringDisplayMetadata& displayMetadata,
54 bool hasLightMetadata,
55 AVContentLightMetadata lightMetadata);
56 void SetToneMapParam(ETONEMAPMETHOD method,
float param);
57 float GetLuminanceValue()
const;
59 void SetConvertFullColorRange(
bool convertFullRange) { m_convertFullRange = convertFullRange; }
61 GLint GetVertexLoc() {
return m_hVertex; }
62 GLint GetYcoordLoc() {
return m_hYcoord; }
63 GLint GetUcoordLoc() {
return m_hUcoord; }
64 GLint GetVcoordLoc() {
return m_hVcoord; }
66 void SetMatrices(
const GLfloat *p,
const GLfloat *m) { m_proj = p; m_model = m; }
67 void SetAlpha(GLfloat alpha) { m_alpha = alpha; }
71 void OnCompiledAndLinked()
override;
72 bool OnEnabled()
override;
73 void OnDisabled()
override;
76 bool m_convertFullRange;
77 EShaderFormat m_format;
81 bool m_hasDisplayMetadata =
false;
82 AVMasteringDisplayMetadata m_displayMetadata;
83 bool m_hasLightMetadata =
false;
84 AVContentLightMetadata m_lightMetadata;
85 bool m_toneMapping =
false;
86 ETONEMAPMETHOD m_toneMappingMethod = VS_TONEMAPMETHOD_REINHARD;
87 float m_toneMappingParam = 1.0;
89 bool m_colorConversion{
false};
95 const GLfloat *m_proj =
nullptr;
96 const GLfloat *m_model =
nullptr;
97 GLfloat m_alpha = 1.0f;
99 std::string m_defines;
101 std::shared_ptr<Shaders::GLSLOutput> m_glslOutput;
108 GLint m_hYuvMat = -1;
109 GLint m_hStretch = -1;
111 GLint m_hGammaSrc = -1;
112 GLint m_hGammaDstInv = -1;
113 GLint m_hPrimMat = -1;
114 GLint m_hToneP1 = -1;
115 GLint m_hCoefsDst = -1;
116 GLint m_hLuminance = -1;
119 GLint m_hVertex = -1;
120 GLint m_hYcoord = -1;
121 GLint m_hUcoord = -1;
122 GLint m_hVcoord = -1;
132 EShaderFormat format,
134 AVColorPrimaries dstPrimaries,
135 AVColorPrimaries srcPrimaries,
137 ETONEMAPMETHOD toneMapMethod,
138 std::shared_ptr<GLSLOutput> output);
145 EShaderFormat format,
147 AVColorPrimaries dstPrimaries,
148 AVColorPrimaries srcPrimaries,
150 ETONEMAPMETHOD toneMapMethod,
151 ESCALINGMETHOD method,
152 std::shared_ptr<GLSLOutput> output);
156 void OnCompiledAndLinked()
override;
157 bool OnEnabled()
override;
159 GLuint m_kernelTex = 0;
160 GLint m_hKernTex = -1;
161 ESCALINGMETHOD m_scaling = VS_SCALINGMETHOD_LANCZOS3_FAST;
Helper class used for YUV to RGB conversions.
Definition: ConversionMatrix.h:144
Definition: LinuxRendererGL.h:30
Definition: YUV2RGBShaderGL.h:128
Definition: YUV2RGBShaderGL.h:31
Definition: YUV2RGBShaderGL.h:141