00001 // -*- Mode: c++ -*- 00002 00003 #ifndef _OSD_CHROMAKEY_H_ 00004 #define _OSD_CHROMAKEY_H_ 00005 00006 #include <QImage> 00007 #include "mythpainter_qimage.h" 00008 #include "mythcontext.h" 00009 #include "videoout_xv.h" 00010 00011 class ChromaKeyOSD 00012 { 00013 public: 00014 ChromaKeyOSD(VideoOutputXv *vo) : 00015 current_size(QSize()), current_rect(QRect()), 00016 videoOutput(vo), img(NULL), image(NULL), painter(NULL), visible(false) 00017 { 00018 memset(&shm_infos, 0, sizeof(XShmSegmentInfo)); 00019 } 00020 ~ChromaKeyOSD(void); 00021 00022 bool ProcessOSD(OSD *osd); 00023 XImage *GetImage() { return visible ? img : NULL; } 00024 MythPainter* GetPainter(void) { return (MythPainter*)painter; } 00025 00026 private: 00027 bool Init(QSize new_size); 00028 void TearDown(void); 00029 bool CreateShmImage(QSize area); 00030 void DestroyShmImage(void); 00031 void BlendOrCopy(uint32_t colour, const QRect &rect); 00032 00033 QSize current_size; 00034 QRect current_rect; 00035 VideoOutputXv *videoOutput; 00036 XImage *img; 00037 XShmSegmentInfo shm_infos; 00038 QImage *image; 00039 MythQImagePainter *painter; 00040 bool visible; 00041 }; 00042 00043 #endif // _OSD_CHROMAKEY_H_
1.6.3