KWin
Loading...
Searching...
No Matches
colorlut3d.cpp
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: 2023 Xaver Hugl <xaver.hugl@gmail.com>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#include "colorlut3d.h"
10#include "colortransformation.h"
11
12#include <QVector3D>
13
14namespace KWin
15{
16
17ColorLUT3D::ColorLUT3D(std::unique_ptr<ColorTransformation> &&transformation, size_t xSize, size_t ySize, size_t zSize)
18 : m_transformation(std::move(transformation))
19 , m_xSize(xSize)
20 , m_ySize(ySize)
21 , m_zSize(zSize)
22{
23}
24
25size_t ColorLUT3D::xSize() const
26{
27 return m_xSize;
28}
29
30size_t ColorLUT3D::ySize() const
31{
32 return m_ySize;
33}
34
35size_t ColorLUT3D::zSize() const
36{
37 return m_zSize;
38}
39
40QVector3D ColorLUT3D::sample(size_t x, size_t y, size_t z)
41{
42 return m_transformation->transform(QVector3D(x / double(m_xSize - 1), y / double(m_ySize - 1), z / double(m_zSize - 1)));
43}
44
45}
ColorLUT3D(std::unique_ptr< ColorTransformation > &&transformation, size_t xSize, size_t ySize, size_t zSize)
QVector3D sample(size_t x, size_t y, size_t z)
size_t zSize() const
size_t xSize() const
size_t ySize() const