ACF $AcfVersion:0$
CDrawBuffer.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtGui/QPixmap>
7#include <QtGui/QPainter>
8
9
10// ACF includes
11#include <istd/TDelPtr.h>
12
13#include <iqt/iqt.h>
14
15
16namespace iview
17{
18
19
20class CDrawBuffer: public QPixmap
21{
22public:
23 typedef QPixmap BaseClass;
24
26
30 void Reset();
31
35 bool IsCreated() const;
36
40 void Create(const QPaintDevice& device, ibase::CSize size);
41
46 void CopyRectTo(const i2d::CRect& source, QPainter& drawContext, istd::CIndex2d contextPos) const;
47
52 void CopyRectTo(const i2d::CRect& source, QPaintDevice& device, istd::CIndex2d devicePos) const;
53
57 QPainter& GetDrawContext();
58
59protected:
61
62private:
63 mutable istd::TDelPtr<QPainter> m_drawContextPtr;
64};
65
66
67// inline methods
68
70{
71}
72
73
75{
77
78 Q_ASSERT(m_drawContextPtr.IsValid());
79
80 return *m_drawContextPtr;
81}
82
83
84} // namespace iview
85
86
87
Simple rectangle with integer bounds.
Definition CRect.h:22
Definition of simple 2D size based on integer values.
Definition CSize.h:18
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:21
Pointer wrapper providing automatic deleting pointed object during destruction.
Definition TDelPtr.h:21
bool IsValid() const
Check if internal pointer not NULL.
void Create(const QPaintDevice &device, ibase::CSize size)
Create new buffer with the given size.
void Reset()
Reset state of this bitmap.
bool IsCreated() const
Check, if bitmap was created.
void CopyRectTo(const i2d::CRect &source, QPaintDevice &device, istd::CIndex2d devicePos) const
Copy rectangle area to specified native paint device.
void CopyRectTo(const i2d::CRect &source, QPainter &drawContext, istd::CIndex2d contextPos) const
Copy rectangle area to specified draw context.
QPainter & GetDrawContext()
Get used painter for drawing operations.
Definition CDrawBuffer.h:74
In this library is defined 2D view concept and standard visualisation objects.