Blender V4.3
AdvancedStrokeShaders.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include "BasicStrokeShaders.h"
13
14namespace Freestyle {
15
22 public:
33 CalligraphicShader(real iMinThickness,
34 real iMaxThickness,
35 const Vec2f &iOrientation,
36 bool clamp);
37
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
76 virtual int shade(Stroke &ioStroke) const;
77
78 protected:
79 float _amount;
80 float _xScale;
82 bool _smooth;
84};
85
94 public:
113 SmoothingShader(int iNbIteration,
114 real iFactorPoint,
115 real ifactorCurvature,
116 real iFactorCurvatureDifference,
117 real iAnisoPoint,
118 real iAnisoNormal,
119 real iAnisoCurvature,
120 real icarricatureFactor);
121
123 virtual ~SmoothingShader() {}
124
126 virtual int shade(Stroke &ioStroke) const;
127
128 protected:
137};
138
139class Smoother {
140 public:
141 Smoother(Stroke &ioStroke);
142
143 virtual ~Smoother();
144
145 void smooth(int nbIterations,
146 real iFactorPoint,
147 real ifactorCurvature,
148 real iFactorCurvatureDifference,
149 real iAnisoPoint,
150 real iAnisoNormal,
151 real iAnisoCurvature,
152 real icarricatureFactor);
153
154 void computeCurvature();
155
156 protected:
164
165 void iteration();
166 void copyVertices();
167
174
177};
178
179class Omitter : public Smoother {
180 public:
181 Omitter(Stroke &ioStroke);
182
183 virtual ~Omitter() {}
184
185 void omit(real sizeWindow, real thrVari, real thrFlat, real lFlat);
186
187 protected:
189
194};
195
198 public:
199 OmissionShader(real sizeWindow, real thrVari, real thrFlat, real lFlat);
200 virtual ~OmissionShader() {}
201
202 virtual int shade(Stroke &ioStroke) const;
203
204 protected:
209};
210
211} /* 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:20
double real
Definition Precision.h:14