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

0001 /*
0002     SPDX-FileCopyrightText: 2023 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "core/graphicsbuffer.h"
0010 
0011 #include <QImage>
0012 
0013 namespace KWin
0014 {
0015 
0016 class KWIN_EXPORT GraphicsBufferView
0017 {
0018 public:
0019     explicit GraphicsBufferView(GraphicsBuffer *buffer, GraphicsBuffer::MapFlags accessFlags = GraphicsBuffer::Read);
0020     ~GraphicsBufferView();
0021 
0022     bool isNull() const;
0023     QImage *image();
0024     const QImage *image() const;
0025 
0026 private:
0027     GraphicsBuffer *m_buffer;
0028     QImage m_image;
0029 };
0030 
0031 } // namespace KWin