Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: include/effects/SkPerlinNoiseShader.h

Issue 25430005: Fix for potential typedef issue Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/effects/SkMorphologyImageFilter.h ('k') | include/effects/SkPixelXorXfermode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPerlinNoiseShader_DEFINED 8 #ifndef SkPerlinNoiseShader_DEFINED
9 #define SkPerlinNoiseShader_DEFINED 9 #define SkPerlinNoiseShader_DEFINED
10 10
11 #include "SkShader.h" 11 #include "SkShader.h"
12 12
13 /** \class SkPerlinNoiseShader 13 /** \class SkPerlinNoiseShader
14 14
15 SkPerlinNoiseShader creates an image using the Perlin turbulence function. 15 SkPerlinNoiseShader creates an image using the Perlin turbulence function.
16 16
17 It can produce tileable noise if asked to stitch tiles and provided a tile s ize. 17 It can produce tileable noise if asked to stitch tiles and provided a tile s ize.
18 In order to fill a large area with repeating noise, set the stitchTiles flag to 18 In order to fill a large area with repeating noise, set the stitchTiles flag to
19 true, and render exactly a single tile of noise. Without this flag, the resu lt 19 true, and render exactly a single tile of noise. Without this flag, the resu lt
20 will contain visible seams between tiles. 20 will contain visible seams between tiles.
21 21
22 The algorithm used is described here : 22 The algorithm used is described here :
23 http://www.w3.org/TR/SVG/filters.html#feTurbulenceElement 23 http://www.w3.org/TR/SVG/filters.html#feTurbulenceElement
24 */ 24 */
25 class SK_API SkPerlinNoiseShader : public SkShader { 25 class SK_API SkPerlinNoiseShader : public SkShader {
26 typedef SkShader INHERITED;
26 struct PaintingData; 27 struct PaintingData;
27 public: 28 public:
28 struct StitchData; 29 struct StitchData;
29 30
30 /** 31 /**
31 * About the noise types : the difference between the 2 is just minor tweak s to the algorithm, 32 * About the noise types : the difference between the 2 is just minor tweak s to the algorithm,
32 * they're not 2 entirely different noises. The output looks different, but once the noise is 33 * they're not 2 entirely different noises. The output looks different, but once the noise is
33 * generated in the [1, -1] range, the output is brought back in the [0, 1] range by doing : 34 * generated in the [1, -1] range, the output is brought back in the [0, 1] range by doing :
34 * kFractalNoise_Type : noise * 0.5 + 0.5 35 * kFractalNoise_Type : noise * 0.5 + 0.5
35 * kTurbulence_Type : abs(noise) 36 * kTurbulence_Type : abs(noise)
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SkPerlinNoiseShader::Type fType; 98 SkPerlinNoiseShader::Type fType;
98 SkScalar fBaseFrequencyX; 99 SkScalar fBaseFrequencyX;
99 SkScalar fBaseFrequencyY; 100 SkScalar fBaseFrequencyY;
100 int fNumOctaves; 101 int fNumOctaves;
101 SkScalar fSeed; 102 SkScalar fSeed;
102 SkISize fTileSize; 103 SkISize fTileSize;
103 bool fStitchTiles; 104 bool fStitchTiles;
104 SkMatrix fMatrix; 105 SkMatrix fMatrix;
105 106
106 PaintingData* fPaintingData; 107 PaintingData* fPaintingData;
107
108 typedef SkShader INHERITED;
109 }; 108 };
110 109
111 #endif 110 #endif
OLDNEW
« no previous file with comments | « include/effects/SkMorphologyImageFilter.h ('k') | include/effects/SkPixelXorXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698