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 ~ClassicLogoDetector();
00017
00018 bool searchForLogo(NuppelVideoPlayer* nvp);
00019 bool doesThisFrameContainTheFoundLogo(unsigned char* frame);
00020 bool pixelInsideLogo(unsigned int x, unsigned int y);
00021
00022 unsigned int getRequiredAvailableBufferForSearch();
00023
00024 private:
00025 void SetLogoMaskArea();
00026 void SetLogoMask(unsigned char *mask);
00027 void DumpLogo(bool fromCurrentFrame,unsigned char* framePtr);
00028 void DetectEdges(VideoFrame *frame, EdgeMaskEntry *edges, int edgeDiff);
00029
00030 ClassicCommDetector* commDetector;
00031 unsigned int frameNumber;
00032 bool previousFrameWasSceneChange;
00033 unsigned int xspacing, yspacing;
00034 unsigned int commDetectBorder;
00035
00036 int commDetectLogoSamplesNeeded;
00037 int commDetectLogoSampleSpacing;
00038 int commDetectLogoSecondsNeeded;
00039 double commDetectLogoGoodEdgeThreshold;
00040 double commDetectLogoBadEdgeThreshold;
00041
00042 EdgeMaskEntry *edgeMask;
00043
00044 unsigned char *logoMaxValues;
00045 unsigned char *logoMinValues;
00046 unsigned char *logoFrame;
00047 unsigned char *logoMask;
00048 unsigned char *logoCheckMask;
00049 unsigned char *tmpBuf;
00050
00051 int logoEdgeDiff;
00052 unsigned int logoFrameCount;
00053 unsigned int logoMinX;
00054 unsigned int logoMaxX;
00055 unsigned int logoMinY;
00056 unsigned int logoMaxY;
00057
00058 bool logoInfoAvailable;
00059 };
00060
00061 #endif
00062
00063
00064