Blender  V3.3
AdvancedStrokeShaders.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include "BasicStrokeShaders.h"
11 
12 namespace Freestyle {
13 
20  public:
31  CalligraphicShader(real iMinThickness,
32  real iMaxThickness,
33  const Vec2f &iOrientation,
34  bool clamp);
35 
38  {
39  }
40 
42  virtual int shade(Stroke &ioStroke) const;
43 
44  protected:
48  bool _clamp;
49 };
50 
57  public:
70  SpatialNoiseShader(float iAmount, float ixScale, int nbOctave, bool smooth, bool pureRandom);
71 
74  {
75  }
76 
78  virtual int shade(Stroke &ioStroke) const;
79 
80  protected:
81  float _amount;
82  float _xScale;
83  int _nbOctave;
84  bool _smooth;
86 };
87 
95 class SmoothingShader : public StrokeShader {
96  public:
115  SmoothingShader(int iNbIteration,
116  real iFactorPoint,
117  real ifactorCurvature,
118  real iFactorCurvatureDifference,
119  real iAnisoPoint,
120  real iAnisoNormal,
121  real iAnisoCurvature,
122  real icarricatureFactor);
123 
126  {
127  }
128 
130  virtual int shade(Stroke &ioStroke) const;
131 
132  protected:
141 };
142 
143 class Smoother {
144  public:
145  Smoother(Stroke &ioStroke);
146 
147  virtual ~Smoother();
148 
149  void smooth(int nbIterations,
150  real iFactorPoint,
151  real ifactorCurvature,
152  real iFactorCurvatureDifference,
153  real iAnisoPoint,
154  real iAnisoNormal,
155  real iAnisoCurvature,
156  real icarricatureFactor);
157 
158  void computeCurvature();
159 
160  protected:
168 
169  void iteration();
170  void copyVertices();
171 
178 
180  bool _safeTest;
181 };
182 
183 class Omitter : public Smoother {
184  public:
185  Omitter(Stroke &ioStroke);
186 
187  virtual ~Omitter()
188  {
189  }
190 
191  void omit(real sizeWindow, real thrVari, real thrFlat, real lFlat);
192 
193  protected:
195 
200 };
201 
203 class OmissionShader : public StrokeShader {
204  public:
205  OmissionShader(real sizeWindow, real thrVari, real thrFlat, real lFlat);
206  virtual ~OmissionShader()
207  {
208  }
209 
210  virtual int shade(Stroke &ioStroke) const;
211 
212  protected:
217 };
218 
219 } /* namespace Freestyle */
Class gathering basic stroke shaders.
CalligraphicShader(real iMinThickness, real iMaxThickness, const Vec2f &iOrientation, bool clamp)
virtual int shade(Stroke &ioStroke) const
OmissionShader(real sizeWindow, real thrVari, real thrFlat, real lFlat)
virtual int shade(Stroke &ioStroke) const
Omitter(Stroke &ioStroke)
void omit(real sizeWindow, real thrVari, real thrFlat, real lFlat)
void smooth(int nbIterations, real iFactorPoint, real ifactorCurvature, real iFactorCurvatureDifference, real iAnisoPoint, real iAnisoNormal, real iAnisoCurvature, real icarricatureFactor)
virtual int shade(Stroke &ioStroke) const
SmoothingShader(int iNbIteration, real iFactorPoint, real ifactorCurvature, real iFactorCurvatureDifference, real iAnisoPoint, real iAnisoNormal, real iAnisoCurvature, real icarricatureFactor)
virtual int shade(Stroke &ioStroke) const
SpatialNoiseShader(float iAmount, float ixScale, int nbOctave, bool smooth, bool pureRandom)
inherits from class Rep
Definition: AppCanvas.cpp:18
double real
Definition: Precision.h:12
T clamp(const T &a, const T &min, const T &max)
smooth(Type::FLOAT, "mask_weight")