InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TranFxConvolutionFilter.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Adobe Developer Technologies
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __TranFxConvolutionFilter_H_DEFINED__
25 #define __TranFxConvolutionFilter_H_DEFINED__
26 
27 class AGMImageAccessor;
28 #include "K2Vector.h"
29 #include "K2Vector.tpp"
30 
50 {
51 public:
54  typedef float Pixel;
55 
56 public:
57 
65  class Kernel
66  {
67  public:
74  Kernel(int32 width, int32 height, const float* coefficients);
75 
78  virtual ~Kernel() {}
79 
80  public:
84  uint32 GetWidth() const {return fWidth;}
85 
89  uint32 GetHeight() const {return fHeight;}
90 
95  int32 GetXOrigin() const {return fXOrigin;}
96 
101  int32 GetYOrigin() const {return fYOrigin;}
102 
106  const float* GetCoefficients() const {return fCoefficients;}
107 
108  public:
115 
116  private:
117  uint32 fWidth;
118  uint32 fHeight;
119  int32 fXOrigin;
120  int32 fYOrigin;
121  const float* fCoefficients;
122  };
123 
124 public:
134  TranFxConvolutionFilter(AGMImageAccessor* agmImage, const bool16 invertGrey, const bool16 applyAlpha);
135 
138  virtual ~TranFxConvolutionFilter();
139 
140 public:
141  // General purpose member functions.
142 
146  void Convolve(Kernel& kernel);
147 
152 
153 public:
154  // Canned effects.
155 
158  void ApplyBlur();
159 
160 private:
161  AGMImageAccessor* fInput;
162  uint32 fInputBytesPerPixel;
163  uint32 fWidth;
164  uint32 fHeight;
166 };
167 
168 #endif // __TranFxConvolutionFilter_H_DEFINED__
169