KiCad PCB EDA Suite
Loading...
Searching...
No Matches
compositor.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2013 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Maciej Suminski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
28
29#ifndef COMPOSITOR_H_
30#define COMPOSITOR_H_
31
32namespace KIGFX
33{
34class COLOR4D;
35
37{
38public:
40 : m_width( 0 ), m_height( 0 )
41 {
42 }
43
44 virtual ~COMPOSITOR()
45 {
46 }
47
51 virtual void Initialize() = 0;
52
59 virtual void Resize( unsigned int aWidth, unsigned int aHeight ) = 0;
60
66 virtual unsigned int CreateBuffer() = 0;
67
73 virtual unsigned int GetBuffer() const = 0;
74
83 virtual void SetBuffer( unsigned int aBufferHandle ) = 0;
84
88 virtual void ClearBuffer( const COLOR4D& aColor ) = 0;
89
93 virtual void Begin() = 0;
94
100 virtual void DrawBuffer( unsigned int aBufferHandle ) = 0;
101
105 virtual void Present() = 0;
106
107protected:
108 unsigned int m_width;
109 unsigned int m_height;
110};
111
112} // namespace KIGFX
113
114#endif /* COMPOSITOR_H_ */
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
virtual void Initialize()=0
Perform primary initialization, necessary to use the object.
virtual void Begin()=0
Call this at the beginning of each frame.
unsigned int m_height
Height of the buffer (in pixels)
Definition compositor.h:109
virtual unsigned int GetBuffer() const =0
Return currently used buffer handle.
virtual ~COMPOSITOR()
Definition compositor.h:44
unsigned int m_width
Width of the buffer (in pixels)
Definition compositor.h:108
virtual void Present()=0
Call this to present the output buffer to the screen.
virtual void ClearBuffer(const COLOR4D &aColor)=0
Clear the selected buffer (set by the SetBuffer() function).
virtual void SetBuffer(unsigned int aBufferHandle)=0
Set the selected buffer as the rendering target.
virtual unsigned int CreateBuffer()=0
Prepare a new buffer that may be used as a rendering target.
virtual void Resize(unsigned int aWidth, unsigned int aHeight)=0
Clear the state of COMPOSITOR, so it has to be reinitialized again with the new dimensions.
virtual void DrawBuffer(unsigned int aBufferHandle)=0
Draw the selected buffer to the output buffer.
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29