FastUIDraw
painter_brush_shader.hpp
Go to the documentation of this file.
1 /*!
2  * \file painter_brush_shader.hpp
3  * \brief file painter_brush_shader.hpp
4  *
5  * Copyright 2019 by Intel.
6  *
7  * Contact: kevin.rogovin@gmail.com
8  *
9  * This Source Code Form is subject to the
10  * terms of the Mozilla Public License, v. 2.0.
11  * If a copy of the MPL was not distributed with
12  * this file, You can obtain one at
13  * http://mozilla.org/MPL/2.0/.
14  *
15  * \author Kevin Rogovin <kevin.rogovin@gmail.com>
16  *
17  */
18 
19 
20 #ifndef FASTUIDRAW_PAINTER_BRUSH_SHADER_HPP
21 #define FASTUIDRAW_PAINTER_BRUSH_SHADER_HPP
23 
24 namespace fastuidraw
25 {
26 
27 /*!\addtogroup PainterShaders
28  * @{
29  */
30 
31  /*!
32  * \brief
33  * A PainterBrushShader represents a shader
34  * for performing a custom brush coloring.
35  */
37  {
38  public:
39  /*!
40  * Ctor for creating a PainterBrushShader which has multiple
41  * sub-shaders. The purpose of sub-shaders is for the case
42  * where multiple shaders have almost same code and those
43  * code differences can be realized by examining a sub-shader
44  * ID.
45  * \param num_sub_shaders number of sub-shaders
46  */
47  explicit
48  PainterBrushShader(unsigned int num_sub_shaders = 1):
49  PainterShader(num_sub_shaders)
50  {}
51 
52  /*!
53  * Ctor to create a PainterBrushShader realized as a sub-shader
54  * of an existing PainterBrushShader
55  * \param parent parent PainterBrushShader that has sub-shaders
56  * \param sub_shader which sub-shader of the parent PainterBrushShader
57  */
59  unsigned int sub_shader):
60  PainterShader(parent, sub_shader)
61  {}
62  };
63 
64 /*! @} */
65 }
66 
67 #endif
PainterBrushShader(unsigned int num_sub_shaders=1)
PainterBrushShader(reference_counted_ptr< PainterBrushShader > parent, unsigned int sub_shader)
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition: colorstop.hpp:28
A PainterShader encapsulates how to draw or blend.
A wrapper over a pointer to implement reference counting.
file painter_shader.hpp
uint32_t sub_shader(void) const
A PainterBrushShader represents a shader for performing a custom brush coloring.
const reference_counted_ptr< PainterShader > & parent(void) const