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);
58 void SetConvertFullColorRange(
bool convertFullRange) { m_convertFullRange = convertFullRange; }
60 GLint GetVertexLoc() {
return m_hVertex; }
61 GLint GetYcoordLoc() {
return m_hYcoord; }
62 GLint GetUcoordLoc() {
return m_hUcoord; }
63 GLint GetVcoordLoc() {
return m_hVcoord; }
65 void SetMatrices(
const GLfloat *p,
const GLfloat *m) { m_proj = p; m_model = m; }
66 void SetAlpha(GLfloat alpha) { m_alpha = alpha; }
70 void OnCompiledAndLinked()
override;
71 bool OnEnabled()
override;
72 void OnDisabled()
override;
75 bool m_convertFullRange;
76 EShaderFormat m_format;
80 bool m_hasDisplayMetadata =
false;
81 AVMasteringDisplayMetadata m_displayMetadata;
82 bool m_hasLightMetadata =
false;
83 AVContentLightMetadata m_lightMetadata;
84 bool m_toneMapping =
false;
85 ETONEMAPMETHOD m_toneMappingMethod = VS_TONEMAPMETHOD_OFF;
86 float m_toneMappingParam = 1.0;
88 bool m_colorConversion{
false};
94 const GLfloat *m_proj =
nullptr;
95 const GLfloat *m_model =
nullptr;
96 GLfloat m_alpha = 1.0f;
98 std::string m_defines;
100 std::shared_ptr<Shaders::GLSLOutput> m_glslOutput;
107 GLint m_hYuvMat = -1;
108 GLint m_hStretch = -1;
110 GLint m_hGammaSrc = -1;
111 GLint m_hGammaDstInv = -1;
112 GLint m_hPrimMat = -1;
113 GLint m_hToneP1 = -1;
114 GLint m_hCoefsDst = -1;
115 GLint m_hLuminance = -1;
118 GLint m_hVertex = -1;
119 GLint m_hYcoord = -1;
120 GLint m_hUcoord = -1;
121 GLint m_hVcoord = -1;
131 EShaderFormat format,
133 AVColorPrimaries dstPrimaries,
134 AVColorPrimaries srcPrimaries,
136 ETONEMAPMETHOD toneMapMethod,
137 std::shared_ptr<GLSLOutput> output);
144 EShaderFormat format,
146 AVColorPrimaries dstPrimaries,
147 AVColorPrimaries srcPrimaries,
149 ETONEMAPMETHOD toneMapMethod,
150 ESCALINGMETHOD method,
151 std::shared_ptr<GLSLOutput> output);
155 void OnCompiledAndLinked()
override;
156 bool OnEnabled()
override;
158 GLuint m_kernelTex = 0;
159 GLint m_hKernTex = -1;
160 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:127
Definition: YUV2RGBShaderGL.h:31
Definition: YUV2RGBShaderGL.h:140