ClangFormat: apply to source, most of intern
[blender.git] / source / blender / blenkernel / BKE_linestyle.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2010 Blender Foundation.
17  * All rights reserved.
18  */
19
20 #ifndef __BKE_LINESTYLE_H__
21 #define __BKE_LINESTYLE_H__
22
23 /** \file
24  * \ingroup bke
25  * \brief Blender kernel freestyle line style functionality.
26  */
27
28 #include "DNA_linestyle_types.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #define LS_MODIFIER_TYPE_COLOR 1
35 #define LS_MODIFIER_TYPE_ALPHA 2
36 #define LS_MODIFIER_TYPE_THICKNESS 3
37 #define LS_MODIFIER_TYPE_GEOMETRY 4
38
39 struct ColorBand;
40 struct Main;
41 struct Object;
42 struct ViewLayer;
43 struct bContext;
44
45 void BKE_linestyle_init(struct FreestyleLineStyle *linestyle);
46 FreestyleLineStyle *BKE_linestyle_new(struct Main *bmain, const char *name);
47 void BKE_linestyle_free(FreestyleLineStyle *linestyle);
48 void BKE_linestyle_copy_data(struct Main *bmain,
49                              struct FreestyleLineStyle *linestyle_dst,
50                              const struct FreestyleLineStyle *linestyle_src,
51                              const int flag);
52 FreestyleLineStyle *BKE_linestyle_copy(struct Main *bmain, const FreestyleLineStyle *linestyle);
53
54 void BKE_linestyle_make_local(struct Main *bmain,
55                               struct FreestyleLineStyle *linestyle,
56                               const bool lib_local);
57
58 FreestyleLineStyle *BKE_linestyle_active_from_view_layer(struct ViewLayer *view_layer);
59
60 LineStyleModifier *BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyle,
61                                                     const char *name,
62                                                     int type);
63 LineStyleModifier *BKE_linestyle_alpha_modifier_add(FreestyleLineStyle *linestyle,
64                                                     const char *name,
65                                                     int type);
66 LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *linestyle,
67                                                         const char *name,
68                                                         int type);
69 LineStyleModifier *BKE_linestyle_geometry_modifier_add(FreestyleLineStyle *linestyle,
70                                                        const char *name,
71                                                        int type);
72
73 LineStyleModifier *BKE_linestyle_color_modifier_copy(FreestyleLineStyle *linestyle,
74                                                      const LineStyleModifier *m,
75                                                      const int flag);
76 LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linestyle,
77                                                      const LineStyleModifier *m,
78                                                      const int flag);
79 LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *linestyle,
80                                                          const LineStyleModifier *m,
81                                                          const int flag);
82 LineStyleModifier *BKE_linestyle_geometry_modifier_copy(FreestyleLineStyle *linestyle,
83                                                         const LineStyleModifier *m,
84                                                         const int flag);
85
86 int BKE_linestyle_color_modifier_remove(FreestyleLineStyle *linestyle,
87                                         LineStyleModifier *modifier);
88 int BKE_linestyle_alpha_modifier_remove(FreestyleLineStyle *linestyle,
89                                         LineStyleModifier *modifier);
90 int BKE_linestyle_thickness_modifier_remove(FreestyleLineStyle *linestyle,
91                                             LineStyleModifier *modifier);
92 int BKE_linestyle_geometry_modifier_remove(FreestyleLineStyle *linestyle,
93                                            LineStyleModifier *modifier);
94
95 bool BKE_linestyle_color_modifier_move(FreestyleLineStyle *linestyle,
96                                        LineStyleModifier *modifier,
97                                        int direction);
98 bool BKE_linestyle_alpha_modifier_move(FreestyleLineStyle *linestyle,
99                                        LineStyleModifier *modifier,
100                                        int direction);
101 bool BKE_linestyle_thickness_modifier_move(FreestyleLineStyle *linestyle,
102                                            LineStyleModifier *modifier,
103                                            int direction);
104 bool BKE_linestyle_geometry_modifier_move(FreestyleLineStyle *linestyle,
105                                           LineStyleModifier *modifier,
106                                           int direction);
107
108 void BKE_linestyle_modifier_list_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase);
109 char *BKE_linestyle_path_to_color_ramp(FreestyleLineStyle *linestyle,
110                                        struct ColorBand *color_ramp);
111
112 bool BKE_linestyle_use_textures(FreestyleLineStyle *linestyle, const bool use_shading_nodes);
113
114 void BKE_linestyle_default_shader(const struct bContext *C, FreestyleLineStyle *linestyle);
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif /* __BKE_LINESTYLE_H__ */