Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Functions
SkPerlinNoiseShaderImpl.cpp File Reference
#include "src/shaders/SkPerlinNoiseShaderImpl.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/effects/SkPerlinNoiseShader.h"
#include "src/base/SkArenaAlloc.h"
#include "src/core/SkEffectPriv.h"
#include "src/core/SkRasterPipeline.h"
#include "src/core/SkRasterPipelineOpContexts.h"
#include "src/core/SkRasterPipelineOpList.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkWriteBuffer.h"
#include "src/shaders/SkPerlinNoiseShaderType.h"
#include <optional>

Go to the source code of this file.

Namespaces

namespace  SkShaders
 

Functions

static bool valid_input (SkScalar baseX, SkScalar baseY, int numOctaves, const SkISize *tileSize, SkScalar seed)
 
void SkRegisterPerlinNoiseShaderFlattenable ()
 
SK_API sk_sp< SkShaderSkShaders::MakeFractalNoise (SkScalar baseFrequencyX, SkScalar baseFrequencyY, int numOctaves, SkScalar seed, const SkISize *tileSize=nullptr)
 
SK_API sk_sp< SkShaderSkShaders::MakeTurbulence (SkScalar baseFrequencyX, SkScalar baseFrequencyY, int numOctaves, SkScalar seed, const SkISize *tileSize=nullptr)
 

Function Documentation

◆ SkRegisterPerlinNoiseShaderFlattenable()

void SkRegisterPerlinNoiseShaderFlattenable ( )

Definition at line 128 of file SkPerlinNoiseShaderImpl.cpp.

128 {
130 // Previous name
131 SkFlattenable::Register("SkPerlinNoiseShaderImpl", SkPerlinNoiseShader::CreateProc);
132}
#define SK_REGISTER_FLATTENABLE(type)
static void Register(const char name[], Factory)

◆ valid_input()

static bool valid_input ( SkScalar  baseX,
SkScalar  baseY,
int  numOctaves,
const SkISize tileSize,
SkScalar  seed 
)
static

Definition at line 111 of file SkPerlinNoiseShaderImpl.cpp.

112 {
113 if (!(baseX >= 0 && baseY >= 0)) {
114 return false;
115 }
116 if (!(numOctaves >= 0 && numOctaves <= SkPerlinNoiseShader::kMaxOctaves)) {
117 return false;
118 }
119 if (tileSize && !(tileSize->width() >= 0 && tileSize->height() >= 0)) {
120 return false;
121 }
122 if (!SkIsFinite(seed)) {
123 return false;
124 }
125 return true;
126}
static bool SkIsFinite(T x, Pack... values)
constexpr int32_t width() const
Definition SkSize.h:36
constexpr int32_t height() const
Definition SkSize.h:37