KWin
Loading...
Searching...
No Matches
rendertarget.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2022 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "core/colorspace.h"
10#include "core/output.h"
11
12#include <QImage>
13
14namespace KWin
15{
16
17class GLFramebuffer;
18class GLTexture;
19
20class KWIN_EXPORT RenderTarget
21{
22public:
23 explicit RenderTarget(GLFramebuffer *fbo, const ColorDescription &colorDescription = ColorDescription::sRGB);
24 explicit RenderTarget(QImage *image, const ColorDescription &colorDescription = ColorDescription::sRGB);
25
26 QSize size() const;
27 OutputTransform transform() const;
28 const ColorDescription &colorDescription() const;
29
30 QImage *image() const;
31 GLFramebuffer *framebuffer() const;
32 GLTexture *texture() const;
33
34private:
35 QImage *m_image = nullptr;
36 GLFramebuffer *m_framebuffer = nullptr;
37 const OutputTransform m_transform;
38 const ColorDescription m_colorDescription;
39};
40
41} // namespace KWin
OpenGL framebuffer object.