MythTV  master
Histogram.h
Go to the documentation of this file.
1 #ifndef _HISTOGRAM_H_
2 #define _HISTOGRAM_H_
3 
4 #include "mythframe.h"
5 
6 class Histogram
7 {
8 public:
9  Histogram() = default;
10  ~Histogram() = default;
11 
12  void generateFromImage(VideoFrame* frame, unsigned int frameWidth,
13  unsigned int frameHeight, unsigned int minScanX,
14  unsigned int maxScanX, unsigned int minScanY,
15  unsigned int maxScanY, unsigned int XSpacing,
16  unsigned int YSpacing);
17  float calculateSimilarityWith(const Histogram&) const;
18  unsigned int getAverageIntensity() const;
19  unsigned int getThresholdForPercentageOfPixels(float percentage) const;
20 
21  // do not override default copy constructor, as the default copy
22  // constructor will do just fine.
23 private:
24  int m_data[256] {0};
25 
26  // prevent division by 0 in case a virgin histogram gets used.
27  unsigned int m_numberOfSamples {1};
28 };
29 
30 #endif
31 
32 /* vim: set expandtab tabstop=4 shiftwidth=4: */
33 
int m_data[256]
Definition: Histogram.h:24
~Histogram()=default
float calculateSimilarityWith(const Histogram &) const
Definition: Histogram.cpp:63
Histogram()=default
unsigned int getAverageIntensity() const
Definition: Histogram.cpp:32
unsigned int m_numberOfSamples
Definition: Histogram.h:27
void generateFromImage(VideoFrame *frame, unsigned int frameWidth, unsigned int frameHeight, unsigned int minScanX, unsigned int maxScanX, unsigned int minScanY, unsigned int maxScanY, unsigned int XSpacing, unsigned int YSpacing)
Definition: Histogram.cpp:8
unsigned int getThresholdForPercentageOfPixels(float percentage) const
Definition: Histogram.cpp:47