File indexing completed on 2024-05-19 05:31:54

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include "kwin_export.h"
0012 
0013 #include <QVector3D>
0014 #include <QVector>
0015 #include <epoxy/gl.h>
0016 #include <functional>
0017 #include <memory>
0018 
0019 namespace KWin
0020 {
0021 
0022 class KWIN_EXPORT GlLookUpTable
0023 {
0024 public:
0025     explicit GlLookUpTable(GLuint handle, size_t size);
0026     ~GlLookUpTable();
0027 
0028     GLuint handle() const;
0029     size_t size() const;
0030 
0031     void bind();
0032 
0033     static std::unique_ptr<GlLookUpTable> create(const std::function<QVector3D(size_t value)> &func, size_t size);
0034 
0035 private:
0036     const GLuint m_handle;
0037     const size_t m_size;
0038 };
0039 
0040 }