Paint.h
1/* Copyright (C) 2015-2024 Marc Boris Duerner
2
3 This library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Lesser General Public
5 License as published by the Free Software Foundation; either
6 version 2.1 of the License, or (at your option) any later version.
7
8 As a special exception, you may use this file as part of a free
9 software library without restriction. Specifically, if other files
10 instantiate templates or use macros or inline functions from this
11 file, or you compile this file and link it with other files to
12 produce an executable, this file does not by itself cause the
13 resulting executable to be covered by the GNU General Public
14 License. This exception does not however invalidate any other
15 reasons why the executable file might be covered by the GNU Library
16 General Public License.
17
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with this library; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26 MA 02110-1301 USA
27*/
28
29#ifndef PT_GFX_PAINT_H
30#define PT_GFX_PAINT_H
31
32#include <Pt/Gfx/Api.h>
33#include <Pt/Gfx/CompositionMode.h>
34#include <Pt/Gfx/Pen.h>
35#include <Pt/Gfx/Brush.h>
36#include <Pt/Gfx/Font.h>
37
38namespace Pt {
39
40namespace Gfx {
41
52class PT_GFX_API Paint
53{
54 public:
58
62
66
70
73 const Pen& pen() const;
74
77 void setPen(const Pen& pen);
78
81 const Brush& brush() const;
82
85 void setBrush(const Brush& brush);
86
89 const Font& font() const;
90
93 void setFont(const Font& font);
94
95 private:
96 Gfx::CompositionMode _compositionMode;
97 Gfx::Pen _pen;
98 Gfx::Brush _brush;
99 Gfx::Font _font;
100};
101
102} // namespace
103
104} // namespace
105
106#endif
Fill color, gradient or texture.
Definition Brush.h:151
How new pixels combine with existing pixels.
Definition CompositionMode.h:49
Font family, size and style.
Definition Font.h:63
const Brush & brush() const
Returns the current brush.
const Pen & pen() const
Returns the current pen.
const Font & font() const
Returns the current font.
Paint()
Constructs the default paint state.
void setBrush(const Brush &brush)
Sets the brush used to fill areas.
void setCompositionMode(const CompositionMode &mode)
Sets the composition mode.
const CompositionMode & compositionMode() const
Returns the current composition mode.
~Paint()
Destroys the paint state.
void setPen(const Pen &pen)
Sets the pen used to stroke lines.
void setFont(const Font &font)
Sets the font used to draw text.
Outline color, width and style.
Definition Pen.h:59
Graphics and imaging services.
Definition Api-Argb32Image.h:12
Core module.
Definition Allocator.h:33