HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CL_SlidingWindow.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_SlidingWindow.h ( Clip Library, C++)
7  *
8  * COMMENTS:
9  * Implements a queue-style sliding window for continuous windowed
10  * operations
11  *
12  */
13 
14 
15 #ifndef __CL_SlidingWindow__
16 #define __CL_SlidingWindow__
17 
18 #include "CL_API.h"
19 #include <UT/UT_NonCopyable.h>
20 #include <SYS/SYS_Types.h>
21 
22 class UT_IStream;
23 class UT_OStream;
24 
26 {
27 public:
28 
29  CL_SlidingWindow(int size, int overlap);
31  virtual ~CL_SlidingWindow();
32 
34 
35  void filterSamples(int n,const fpreal *source,fpreal *dest);
36  void shiftSamples(int nsource, const fpreal *source,
37  int ndest, fpreal *dest, int shift);
38 
39  void setOverlap(int overlap);
40  void resize(int size, int preserve = 0);
41 
42  virtual void reset(fpreal val = 0.0);
43  virtual int maxFilterSamples();
44 
45  virtual void save(UT_OStream &os);
46  virtual bool load(UT_IStream &is, int version);
47 
48 private:
49 
50  // override this function to do the operation you want
51  virtual void doWindowOp(int nsamples,fpreal *dest);
52  virtual void doShiftOp(int nsamples,const fpreal *source,int nshift);
53 
54 protected:
56  int myOverlap;
58 
61 };
62 
63 #endif
#define CL_API
Definition: CL_API.h:10
GLdouble n
Definition: glcorearb.h:2008
GLboolean reset
Definition: glad.h:5138
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GT_API const UT_StringHolder version
GLsizeiptr size
Definition: glcorearb.h:664
ImageBuf OIIO_API resize(const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, ROI roi={}, int nthreads=0)
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint GLfloat * val
Definition: glcorearb.h:1608