KWin
Loading...
Searching...
No Matches
src
core
rendertarget.cpp
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
#include "
core/rendertarget.h
"
8
#include "
opengl/glutils.h
"
9
10
namespace
KWin
11
{
12
13
RenderTarget::RenderTarget
(
GLFramebuffer
*fbo,
const
ColorDescription
&colorDescription)
14
: m_framebuffer(fbo)
15
, m_transform(fbo->colorAttachment() ? fbo->colorAttachment()->contentTransform() :
OutputTransform
())
16
, m_colorDescription(colorDescription)
17
{
18
}
19
20
RenderTarget::RenderTarget
(QImage *image,
const
ColorDescription
&colorDescription)
21
: m_image(image)
22
, m_colorDescription(colorDescription)
23
{
24
}
25
26
QSize
RenderTarget::size
()
const
27
{
28
if
(m_framebuffer) {
29
return
m_framebuffer->
size
();
30
}
else
if
(m_image) {
31
return
m_image->size();
32
}
else
{
33
Q_UNREACHABLE();
34
}
35
}
36
37
OutputTransform
RenderTarget::transform
()
const
38
{
39
return
m_transform;
40
}
41
42
GLFramebuffer
*
RenderTarget::framebuffer
()
const
43
{
44
return
m_framebuffer;
45
}
46
47
GLTexture
*
RenderTarget::texture
()
const
48
{
49
return
m_framebuffer->
colorAttachment
();
50
}
51
52
QImage *
RenderTarget::image
()
const
53
{
54
return
m_image;
55
}
56
57
const
ColorDescription
&
RenderTarget::colorDescription
()
const
58
{
59
return
m_colorDescription;
60
}
61
62
}
// namespace KWin
KWin::ColorDescription
Definition
colorspace.h:103
KWin::GLFramebuffer
OpenGL framebuffer object.
Definition
glframebuffer.h:37
KWin::GLFramebuffer::size
QSize size() const
Definition
glframebuffer.h:75
KWin::GLFramebuffer::colorAttachment
GLTexture * colorAttachment() const
Definition
glframebuffer.cpp:318
KWin::GLTexture
Definition
gltexture.h:40
KWin::OutputTransform
Definition
output.h:37
KWin::RenderTarget::framebuffer
GLFramebuffer * framebuffer() const
Definition
rendertarget.cpp:42
KWin::RenderTarget::size
QSize size() const
Definition
rendertarget.cpp:26
KWin::RenderTarget::texture
GLTexture * texture() const
Definition
rendertarget.cpp:47
KWin::RenderTarget::RenderTarget
RenderTarget(GLFramebuffer *fbo, const ColorDescription &colorDescription=ColorDescription::sRGB)
Definition
rendertarget.cpp:13
KWin::RenderTarget::image
QImage * image() const
Definition
rendertarget.cpp:52
KWin::RenderTarget::colorDescription
const ColorDescription & colorDescription() const
Definition
rendertarget.cpp:57
KWin::RenderTarget::transform
OutputTransform transform() const
Definition
rendertarget.cpp:37
glutils.h
KWin
Definition
activation_test.cpp:20
rendertarget.h
Generated on Sat Feb 17 2024 01:42:09 for KWin by
1.10.0