20 : m_pipeline(cmsPipelineAlloc(nullptr, 3, 3))
21 , m_stages(std::move(stages))
24 qCWarning(KWIN_CORE) <<
"Failed to allocate cmsPipeline!";
28 for (
auto &stage : m_stages) {
29 if (!cmsPipelineInsertStage(m_pipeline, cmsAT_END, stage->stage())) {
30 qCWarning(KWIN_CORE) <<
"Failed to insert cmsPipeline stage!";
68 const uint16_t in[3] = {r, g, b};
69 uint16_t out[3] = {0, 0, 0};
70 cmsPipelineEval16(in, out, m_pipeline);
71 return {out[0], out[1], out[2]};
83 std::array<double, 3> curveParams = {1.0, scale.x(), 0.0};
84 auto r = cmsBuildParametricToneCurve(
nullptr, 2, curveParams.data());
85 curveParams = {1.0, scale.y(), 0.0};
86 auto g = cmsBuildParametricToneCurve(
nullptr, 2, curveParams.data());
87 curveParams = {1.0, scale.z(), 0.0};
88 auto b = cmsBuildParametricToneCurve(
nullptr, 2, curveParams.data());
90 qCWarning(KWIN_CORE) <<
"Failed to build tone curves";
93 const std::array curves = {r, g, b};
94 const auto stage = cmsStageAllocToneCurves(
nullptr, 3, curves.data());
96 qCWarning(KWIN_CORE) <<
"Failed to allocate tone curves";
99 std::vector<std::unique_ptr<ColorPipelineStage>> stages;
100 stages.push_back(std::make_unique<ColorPipelineStage>(stage));
101 auto transform = std::make_unique<ColorTransformation>(std::move(stages));