KWin
Loading...
Searching...
No Matches
imageitem.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 "scene/item.h"
10
11#include <QImage>
12
13namespace KWin
14{
15
16class GLTexture;
17
18class KWIN_EXPORT ImageItem : public Item
19{
20 Q_OBJECT
21
22public:
23 explicit ImageItem(Scene *scene, Item *parent = nullptr);
24
25 QImage image() const;
26 void setImage(const QImage &image);
27
28protected:
29 QImage m_image;
30};
31
33{
34 Q_OBJECT
35
36public:
37 explicit ImageItemOpenGL(Scene *scene, Item *parent = nullptr);
38 ~ImageItemOpenGL() override;
39
40 GLTexture *texture() const;
41
42protected:
43 void preprocess() override;
44 WindowQuadList buildQuads() const override;
45
46private:
47 std::unique_ptr<GLTexture> m_texture;
48 qint64 m_textureKey = 0;
49};
50
51} // namespace KWin
ImageItemOpenGL(Scene *scene, Item *parent=nullptr)
Definition imageitem.cpp:29
void preprocess() override
Definition imageitem.cpp:43
GLTexture * texture() const
Definition imageitem.cpp:38
WindowQuadList buildQuads() const override
Definition imageitem.cpp:64
~ImageItemOpenGL() override
Definition imageitem.cpp:34
Scene * scene() const
Definition item.cpp:32