00001 #ifndef _CLASSICLOGOGEDETECTOR_H_
00002 #define _CLASSICLOGOGEDETECTOR_H_
00003
00004 #include "LogoDetectorBase.h"
00005
00006 typedef struct edgemaskentry EdgeMaskEntry;
00007 typedef struct VideoFrame_ VideoFrame;
00008 class ClassicCommDetector;
00009
00010 class ClassicLogoDetector : public LogoDetectorBase
00011 {
00012 public:
00013 ClassicLogoDetector(ClassicCommDetector* commDetector,unsigned int width,
00014 unsigned int height, unsigned int commdetectborder,
00015 unsigned int xspacing, unsigned int yspacing);
00016 virtual void deleteLater(void);
00017
00018 bool searchForLogo(MythPlayer* player);
00019 bool doesThisFrameContainTheFoundLogo(unsigned char* frame);
00020 bool pixelInsideLogo(unsigned int x, unsigned int y);
00021
00022 unsigned int getRequiredAvailableBufferForSearch();
00023
00024 protected:
00025 virtual ~ClassicLogoDetector() {}
00026
00027 private:
00028 void SetLogoMaskArea();
00029 void SetLogoMask(unsigned char *mask);
00030 void DumpLogo(bool fromCurrentFrame,unsigned char* framePtr);
00031 void DetectEdges(VideoFrame *frame, EdgeMaskEntry *edges, int edgeDiff);
00032
00033 ClassicCommDetector* commDetector;
00034 unsigned int frameNumber;
00035 bool previousFrameWasSceneChange;
00036 unsigned int xspacing, yspacing;
00037 unsigned int commDetectBorder;
00038
00039 int commDetectLogoSamplesNeeded;
00040 int commDetectLogoSampleSpacing;
00041 int commDetectLogoSecondsNeeded;
00042 double commDetectLogoGoodEdgeThreshold;
00043 double commDetectLogoBadEdgeThreshold;
00044
00045 EdgeMaskEntry *edgeMask;
00046
00047 unsigned char *logoMaxValues;
00048 unsigned char *logoMinValues;
00049 unsigned char *logoFrame;
00050 unsigned char *logoMask;
00051 unsigned char *logoCheckMask;
00052 unsigned char *tmpBuf;
00053
00054 int logoEdgeDiff;
00055 unsigned int logoFrameCount;
00056 unsigned int logoMinX;
00057 unsigned int logoMaxX;
00058 unsigned int logoMinY;
00059 unsigned int logoMaxY;
00060
00061 bool logoInfoAvailable;
00062 };
00063
00064 #endif
00065
00066
00067