MythTV  master
BorderDetector.h
Go to the documentation of this file.
1 /*
2  * BorderDetector
3  *
4  * Attempt to infer content boundaries of an image by looking for rows and
5  * columns of pixels whose values fall within some narrow range.
6  *
7  * Handle letterboxing, pillarboxing, and combinations of the two. Handle cases
8  * where letterboxing embedded inside of pillarboxing (or vice versa) uses a
9  * different filler color.
10  */
11 
12 #ifndef __BORDERDETECTOR_H__
13 #define __BORDERDETECTOR_H__
14 
15 typedef struct AVFrame AVFrame;
16 class MythPlayer;
17 class TemplateFinder;
18 
20 {
21 public:
22  /* Ctor/dtor. */
23  BorderDetector(void);
24 
25  int MythPlayerInited(const MythPlayer *player);
26  void setLogoState(TemplateFinder *finder);
27 
28  static const long long UNCACHED = -1;
29  int getDimensions(const AVFrame *pgm, int pgmheight, long long frameno,
30  int *prow, int *pcol, int *pwidth, int *pheight);
31 
32  int reportTime(void);
33 
34 private:
36  const struct AVFrame *m_logo {nullptr};
37  int m_logorow {-1};
38  int m_logocol {-1};
39  int m_logowidth {-1};
40  int m_logoheight {-1};
41 
42  long long m_frameno {-1}; /* frame number */
43  int m_row {-1}; /* content location */
44  int m_col {-1}; /* content location */
45  int m_width {-1}; /* content dimensions */
46  int m_height {-1}; /* content dimensions */
47  bool m_ismonochromatic {false};
48 
49  /* Debugging. */
50  int m_debugLevel {0};
51  struct timeval m_analyze_time;
52  bool m_time_reported {false};
53 };
54 
55 #endif /* !__BORDERDETECTOR_H__ */
56 
57 /* vim: set expandtab tabstop=4 shiftwidth=4: */
struct AVFrame AVFrame
TemplateFinder * m_logoFinder
long long m_frameno
void setLogoState(TemplateFinder *finder)
const struct AVFrame * m_logo
int MythPlayerInited(const MythPlayer *player)
static const long long UNCACHED
struct timeval m_analyze_time
int reportTime(void)
int getDimensions(const AVFrame *pgm, int pgmheight, long long frameno, int *prow, int *pcol, int *pwidth, int *pheight)