File indexing completed on 2025-03-16 11:20:42
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 #pragma once 0010 0011 #include <memory> 0012 #include <stdint.h> 0013 #include <tuple> 0014 #include <vector> 0015 0016 #include "kwin_export.h" 0017 0018 typedef struct _cmsPipeline_struct cmsPipeline; 0019 0020 namespace KWin 0021 { 0022 0023 class ColorPipelineStage; 0024 0025 class KWIN_EXPORT ColorTransformation 0026 { 0027 public: 0028 ColorTransformation(std::vector<std::unique_ptr<ColorPipelineStage>> &&stages); 0029 ~ColorTransformation(); 0030 0031 bool valid() const; 0032 0033 std::tuple<uint16_t, uint16_t, uint16_t> transform(uint16_t r, uint16_t g, uint16_t b) const; 0034 0035 private: 0036 cmsPipeline *const m_pipeline; 0037 const std::vector<std::unique_ptr<ColorPipelineStage>> m_stages; 0038 bool m_valid = true; 0039 }; 0040 0041 }