Flutter Engine
The Flutter Engine
Classes | Functions
AnimBlurSlide.cpp File Reference
#include "include/core/SkBlurTypes.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkMaskFilter.h"
#include "src/base/SkRandom.h"
#include "tools/viewer/Slide.h"
#include <iterator>

Go to the source code of this file.

Classes

class  AnimBlurSlide
 

Functions

SkScalar get_anim_sin (double secs, SkScalar amplitude, SkScalar periodInSec, SkScalar phaseInSec)
 

Function Documentation

◆ get_anim_sin()

SkScalar get_anim_sin ( double  secs,
SkScalar  amplitude,
SkScalar  periodInSec,
SkScalar  phaseInSec 
)

Definition at line 17 of file AnimBlurSlide.cpp.

17 {
18 if (!periodInSec) {
19 return 0;
20 }
21 double t = secs + phaseInSec;
22 t *= (2 * SK_ScalarPI) / periodInSec;
23 amplitude = SK_ScalarHalf * amplitude;
24 return amplitude * SkDoubleToScalar(sin(t)) + amplitude;
25}
#define SK_ScalarHalf
Definition: SkScalar.h:19
#define SkDoubleToScalar(x)
Definition: SkScalar.h:64
#define SK_ScalarPI
Definition: SkScalar.h:21