1 //  SuperTux
2 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3 //                2018 Ingo Ruhnke <grumbel@gmail.com>
4 //
5 //  This program is free software: you can redistribute it and/or modify
6 //  it under the terms of the GNU General Public License as published by
7 //  the Free Software Foundation, either version 3 of the License, or
8 //  (at your option) any later version.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef HEADER_SUPERTUX_VIDEO_PAINT_STYLE_HPP
19 #define HEADER_SUPERTUX_VIDEO_PAINT_STYLE_HPP
20 
21 #include "video/blend.hpp"
22 #include "video/color.hpp"
23 #include "video/flip.hpp"
24 
25 class PaintStyle final
26 {
27 public:
PaintStyle()28   PaintStyle() :
29     m_color(Color::WHITE),
30     m_alpha(1.0f),
31     m_blend(),
32     m_flip(NO_FLIP)
33   {}
34 
set_color(const Color & color)35   PaintStyle& set_color(const Color& color) {
36     m_color = color;
37     return *this;
38   }
39 
set_alpha(const float & alpha)40   PaintStyle& set_alpha(const float& alpha) {
41     m_alpha = alpha;
42     return *this;
43   }
44 
set_blend(const Blend & blend)45   PaintStyle& set_blend(const Blend& blend) {
46     m_blend = blend;
47     return *this;
48   }
49 
set_flip(const Flip & flip)50   PaintStyle& set_flip(const Flip& flip) {
51     m_flip = flip;
52     return *this;
53   }
54 
get_color() const55   const Color& get_color() const { return m_color; }
get_alpha() const56   const float& get_alpha() const { return m_alpha; }
get_blend() const57   const Blend& get_blend() const { return m_blend; }
get_flip() const58   const Flip& get_flip() const { return m_flip; }
59 
60 private:
61   Color m_color;
62   float m_alpha;
63   Blend m_blend;
64   Flip m_flip;
65 };
66 
67 #endif
68 
69 /* EOF */
70