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
15using AVFrame = struct AVFrame;
16class MythPlayer;
17class TemplateFinder;
18
20{
21public:
22 /* Ctor/dtor. */
23 BorderDetector(void);
24
25 int MythPlayerInited(const MythPlayer *player);
26 void setLogoState(TemplateFinder *finder);
27
28 static const long long kUncached = -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
34private:
35 void getDimensionsReal(const AVFrame *pgm, int pgmheight, long long frameno);
37 const struct AVFrame *m_logo {nullptr};
38 int m_logoRow {-1};
39 int m_logoCol {-1};
40 int m_logoWidth {-1};
41 int m_logoHeight {-1};
42
43 long long m_frameNo {-1}; /* frame number */
44 int m_row {-1}; /* content location */
45 int m_col {-1}; /* content location */
46 int m_width {-1}; /* content dimensions */
47 int m_height {-1}; /* content dimensions */
48 bool m_isMonochromatic {false};
49
50 /* Debugging. */
51 int m_debugLevel {0};
52 std::chrono::microseconds m_analyzeTime {0us};
53 bool m_timeReported {false};
54};
55
56#endif /* !BORDERDETECTOR_H */
57
58/* vim: set expandtab tabstop=4 shiftwidth=4: */
AVFrame AVFrame
std::chrono::microseconds m_analyzeTime
int getDimensions(const AVFrame *pgm, int pgmheight, long long frameno, int *prow, int *pcol, int *pwidth, int *pheight)
void getDimensionsReal(const AVFrame *pgm, int pgmheight, long long frameno)
static const long long kUncached
TemplateFinder * m_logoFinder
void setLogoState(TemplateFinder *finder)
int reportTime(void)
int MythPlayerInited(const MythPlayer *player)
long long m_frameNo
const struct AVFrame * m_logo