Version: 0.6.0
stretch.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: pixel field stretch classes.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2011 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 
23 #include "wxgis/carto/carto.h"
24 
25 //TODO:
26 //esriRasterStretch_NONE 0 Stretch is not applied.
27 //esriRasterStretch_DefaultFromSource 1 Stretch is default type.
28 //esriRasterStretch_Custom 2 Stretch is a custom type.
29 //esriRasterStretch_StandardDeviations 3 Stretch is a standard deviation type.
30 //esriRasterStretch_HistogramEqualize 4 Stretch is a histogram equalization type.
31 //esriRasterStretch_MinimumMaximum 5 Stretch is a minimum-maximum type.
32 //esriRasterStretch_HistogramSpecification 6 Stretch is a Histogram Specification type.
33 //esriRasterStretch_Count 7 Stretch is a count type.
34 
35 #define DEFAULT_STDDEV 60.0
36 
40 enum wxGISEnumRasterStretch
41 {
42  enumGISRasterStretchNone = 0,
43  enumGISRasterStretchStdDev
44 };
45 
53 {
54 public:
55  wxGISStretch(double dfMin = 0.0, double dfMax = 255.0, double dfMean = 127.5, double dfStdDev = DEFAULT_STDDEV, double dfNoData = NOTNODATA);
56  virtual ~wxGISStretch(void);
57  virtual unsigned char GetValue(const double *pdfInput);
58  virtual bool IsNoData(const double& cVal);
59  virtual void SetNoData(double dfNoData);
60  virtual double GetNoData(void);
61  virtual void SetInvert(bool bInvert);
62  virtual bool GetInvert(void);
63  virtual void SetStdDevParam(double dfStdDevParam);
64  virtual double GetStdDevParam(void);
65  virtual void SetStats(double dfMin = 0.0, double dfMax = 255.0, double dfMean = 127.5, double dfStdDev = DEFAULT_STDDEV);
66 protected:
67  virtual void RecalcEquation(void);
68  virtual void CalcEquation(double dfMin, double dfMax);
69  //AdjastBritnessContrast
70 protected:
71  double m_dfNoData;
72  double m_dfMin;
73  double m_dfMax;
74  double m_dfMean;
75  double m_dfStdDev;
76  bool m_bInvert;
77  double m_dfStdDevParam;
78  wxGISEnumRasterStretch m_eType;
79 protected:
80  double m_dfM, m_dfDX;
81 };
82 
83 //TODO: esriRasterStretchStatsTypeEnum Constants
84 //Raster stretch statistics types.
85 //esriRasterStretchStats_AreaOfView 0 Stretch stats from current Area Of View.
86 //esriRasterStretchStats_Dataset 1 Stretch stats from current Dataset being rendered.
87 //esriRasterStretchStats_GlobalStats 2 Stretch stats from global stats definition.
88 
89 //stretch - none, custom, standard derivations, histogram equalize, min-max, histogram specification, percent clip
90 //class wxGISStra : public wxGISStretch
91 //{
92 //};
The base class for stretch from pixel field to display field.
Definition: stretch.h:52