KWin
Loading...
Searching...
No Matches
colortransformation.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include <memory>
12#include <stdint.h>
13#include <tuple>
14#include <vector>
15
16#include "kwin_export.h"
17
18typedef struct _cmsPipeline_struct cmsPipeline;
19class QVector3D;
20
21namespace KWin
22{
23
24class ColorPipelineStage;
25
26class KWIN_EXPORT ColorTransformation
27{
28public:
29 ColorTransformation(std::vector<std::unique_ptr<ColorPipelineStage>> &&stages);
31
32 void append(ColorTransformation *transformation);
33
34 bool valid() const;
35
36 std::tuple<uint16_t, uint16_t, uint16_t> transform(uint16_t r, uint16_t g, uint16_t b) const;
37 QVector3D transform(QVector3D in) const;
38
39 static std::unique_ptr<ColorTransformation> createScalingTransform(const QVector3D &scale);
40
41private:
42 cmsPipeline *const m_pipeline;
43 std::vector<std::unique_ptr<ColorPipelineStage>> m_stages;
44 bool m_valid = true;
45};
46
47}
struct _cmsPipeline_struct cmsPipeline