KWin
Loading...
Searching...
No Matches
icc_shader.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6#pragma once
7
8#include <QMatrix4x4>
9#include <QSizeF>
10#include <memory>
11
12namespace KWin
13{
14
15class IccProfile;
16class GLShader;
17class GlLookUpTable;
18class GlLookUpTable3D;
19class GLTexture;
20
22{
23public:
24 explicit IccShader();
25 ~IccShader();
26
27 GLShader *shader() const;
28 void setUniforms(const std::shared_ptr<IccProfile> &profile, float sdrBrightness, const QVector3D &channelFactors);
29
30private:
31 bool setProfile(const std::shared_ptr<IccProfile> &profile);
32
33 std::unique_ptr<GLShader> m_shader;
34 std::shared_ptr<IccProfile> m_profile;
35
36 QMatrix4x4 m_toXYZD50;
37 std::unique_ptr<GlLookUpTable> m_B;
38 QMatrix4x4 m_matrix2;
39 std::unique_ptr<GlLookUpTable> m_M;
40 std::unique_ptr<GlLookUpTable3D> m_C;
41 std::unique_ptr<GlLookUpTable> m_A;
42 struct Locations
43 {
44 int src;
45 int sdrBrightness;
46 int toXYZD50;
47 int bsize;
48 int bsampler;
49 int matrix2;
50 int msize;
51 int msampler;
52 int csize;
53 int csampler;
54 int asize;
55 int asampler;
56 };
57 Locations m_locations;
58};
59
60}
void setUniforms(const std::shared_ptr< IccProfile > &profile, float sdrBrightness, const QVector3D &channelFactors)
GLShader * shader() const