OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimMeanMedianFilter.h
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: MIT
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 //
10 //*******************************************************************
11 // $Id: ossimMeanMedianFilter.h 15766 2009-10-20 12:37:09Z gpotts $
12 #ifndef ossimMeanMedianFilter_HEADER
13 #define ossimMeanMedianFilter_HEADER
14 
16 
26 {
27 public:
28 
30  {
32  OSSIM_MEDIAN = 0,
33 
35  OSSIM_MEDIAN_FILL_NULLS = 1,
36 
38  OSSIM_MEDIAN_NULL_CENTER_ONLY = 2,
39 
41  OSSIM_MEAN = 3,
42 
43  /* Applies filter to all pixels including null center pixels. */
44  OSSIM_MEAN_FILL_NULLS = 4,
45 
47  OSSIM_MEAN_NULL_CENTER_ONLY = 5
48  };
49 
51 
52  virtual ~ossimMeanMedianFilter();
53 
55  ossim_uint32 resLevel=0);
56  virtual void initialize();
57 
58  void setWindowSize(ossim_uint32 windowSize);
59  ossim_uint32 getWindowSize()const;
60 
65  void setAutoGrowRectFlag(bool flag);
66  bool getAutoGrowRectFlag() const;
67 
68  void setFilterType(ossimMeanMedianFilterType type);
69  void setFilterType(const ossimString& type);
70  ossimString getFilterTypeString() const;
71  void getFilterTypeList(std::vector<ossimString>& list) const;
72 
73  virtual void setProperty(ossimRefPtr<ossimProperty> property);
74  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
75  virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
76 
81  virtual bool saveState(ossimKeywordlist& kwl,
82  const char* prefix=0)const;
83 
88  virtual bool loadState(const ossimKeywordlist& kwl,
89  const char* prefix=0);
90 
95  virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
96 
97 protected:
101 
104 
110 
111  void applyFilter(ossimRefPtr<ossimImageData>& input);
112 
113  template <class T>
114  void applyMean(T dummyVariable,
115  ossimRefPtr<ossimImageData>& inputData);
116  template <class T>
117  void applyMeanNullCenterOnly(T dummyVariable,
118  ossimRefPtr<ossimImageData>& inputData);
119 
120  template <class T>
121  void applyMedian(T dummyVariable,
122  ossimRefPtr<ossimImageData>& inputData);
123  template <class T>
124  void applyMedianNullCenterOnly(T dummyVariable,
125  ossimRefPtr<ossimImageData>& inputData);
126 TYPE_DATA
127 };
128 
129 #endif
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
virtual void setProperty(ossimRefPtr< ossimProperty > property)
ossimMeanMedianFilterType theFilterType
Represents serializable keyword/value map.
ossimRefPtr< ossimImageData > theTile
bool theEnableFillNullFlag
Used by applyMean and applyMedian for "fill null" modes.
bool theAutoGrowRectFlag
If true rectangle is expanded by half filter in each direction if the theFilterType fills nulls...
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
#define OSSIM_DLL
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)