HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CL_Easings.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CL_Easings.h ( Clip Library, C++)
7  *
8  * COMMENTS:
9  * Applies Easings to input data
10  */
11 
12 
13 #ifndef __CL_Easings__
14 #define __CL_Easings__
15 
16 #include "CL_API.h"
17 #include <SYS/SYS_Types.h>
18 #include <SYS/SYS_Math.h>
19 
20 enum class CL_EasingType
21 {
22  CL_IN,
23  CL_OUT,
24  CL_INOUT
25 };
26 
27 // static methods to do easings. These functions expect the input to be
28 // between 0-1
29 
31 {
32 public:
33 
34  static fpreal sine(const fpreal input, const CL_EasingType type);
35 
36  static fpreal pow(const fpreal input, const fpreal exponent,
37  const CL_EasingType);
38 
39  static fpreal quad(const fpreal input, const CL_EasingType type)
40  {
41  return pow(input, 2, type);
42  }
43  static fpreal cubic(const fpreal input, const CL_EasingType type)
44  {
45  return pow(input, 3, type);
46  }
47 
48  static fpreal quart(const fpreal input, const CL_EasingType type)
49  {
50  return pow(input, 4, type);
51  }
52 
53  static fpreal quint(const fpreal input, const CL_EasingType type)
54  {
55  return pow(input, 5, type);
56  }
57 
58  static fpreal exp(const fpreal input, const CL_EasingType type);
59 
60  static fpreal circ(const fpreal input, const CL_EasingType type);
61 
62  static fpreal back(const fpreal input, const CL_EasingType type);
63 
64  static fpreal elastic(const fpreal input, const CL_EasingType type);
65 
66  static fpreal bounce(const fpreal input, const CL_EasingType type);
67 
68 };
69 
70 #endif
static fpreal cubic(const fpreal input, const CL_EasingType type)
Definition: CL_Easings.h:43
ImageBuf OIIO_API pow(const ImageBuf &A, cspan< float > B, ROI roi={}, int nthreads=0)
#define CL_API
Definition: CL_API.h:10
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
CL_EasingType
Definition: CL_Easings.h:20
static fpreal quad(const fpreal input, const CL_EasingType type)
Definition: CL_Easings.h:39
fpreal64 fpreal
Definition: SYS_Types.h:283
static fpreal quart(const fpreal input, const CL_EasingType type)
Definition: CL_Easings.h:48
static fpreal quint(const fpreal input, const CL_EasingType type)
Definition: CL_Easings.h:53