HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 <SYS/SYS_Types.h>
20 
21 class UT_IStream;
22 class UT_OStream;
23 
25 {
26 public:
27 
28  CL_SlidingWindow(int size, int overlap);
30  virtual ~CL_SlidingWindow();
31 
32  void filterSamples(int n,const fpreal *source,fpreal *dest);
33  void shiftSamples(int nsource, const fpreal *source,
34  int ndest, fpreal *dest, int shift);
35 
36  void setOverlap(int overlap);
37  void resize(int size, int preserve = 0);
38 
39  virtual void reset(fpreal val = 0.0);
40  virtual int maxFilterSamples();
41 
42  virtual void save(UT_OStream &os);
43  virtual bool load(UT_IStream &is, int version);
44 
45 private:
46 
47  // override this function to do the operation you want
48  virtual void doWindowOp(int nsamples,fpreal *dest);
49  virtual void doShiftOp(int nsamples,const fpreal *source,int nshift);
50 
51 protected:
53  int myOverlap;
55 
58 };
59 
60 #endif
GLsizeiptr size
Definition: glcorearb.h:663
#define CL_API
Definition: CL_API.h:10
GLdouble n
Definition: glcorearb.h:2007
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
double fpreal
Definition: SYS_Types.h:263
GLuint GLfloat * val
Definition: glcorearb.h:1607