xref: /aosp_15_r20/external/skia/src/shaders/SkPerlinNoiseShaderType.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1 /*
2  * Copyright 2013 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 #ifndef SkPerlinNoiseShaderType_DEFINED
8 #define SkPerlinNoiseShaderType_DEFINED
9 
10 /**
11  * About the noise types : the difference between the first two is just minor tweaks to the
12  * algorithm; they're not two entirely different noises. The output looks different, but once the
13  * noise is generated in the [1, -1] range, the output is brought back in the [0, 1] range by doing:
14  *   kFractalNoise : noise * 0.5 + 0.5
15  *   kTurbulence   : abs(noise)
16  * Very little differs between the two types, although you can tell the difference visually.
17  */
18 enum class SkPerlinNoiseShaderType { kFractalNoise, kTurbulence, kLast = kTurbulence };
19 
20 #endif
21