/*************************************************************************************** * * filter.h is part of SimpleSkyCam. * *****************************************************************************************/ #ifndef _FILTER_H_ #define _FILTER_H_ #include "gui.h" #include "config.h" #include "video.h" #include "videoframe.h" class Filter { private: int running; VideoFrame inFrame; // input frame int inFrameNew; // new input frame; VideoFrame oldFrame; // oldinput frame VideoFrame temp; // temporary image VideoFrame tempgtk; // temp image for gtk FloatImage image; // output image VideoFrame imagegtk; // output image -- send to gtk GMutex mutexout; GMutex mutexin; GMutex mutextmp; // for access the temp image GMutex mutex; // general mutex for changing settings GThread *thread; int objectW; // object Image Size Width int objectH; // object Image Size Height float *fpixels; // void InputDetect(); void ComposeOutput(); public: Filter(); ~Filter(); int NewFrame (VideoFrame *newframe); // // Thread Releated Functions (maybe soon private?) int TryLockInMutex() { return g_mutex_trylock(&mutextmp); }; void LockInMutex() { g_mutex_lock(&mutextmp);}; void UnLockInMutex() { g_mutex_unlock(&mutextmp);}; int TryLockTempMutex() { return g_mutex_trylock(&mutextmp); }; void LockTempMutex() { g_mutex_lock(&mutextmp);}; void UnLockTempMutex() { g_mutex_unlock(&mutextmp);}; int TryLockOutMutex() { return g_mutex_trylock(&mutexout); }; void LockOutMutex() { g_mutex_lock(&mutexout);}; void UnLockOutMutex() { g_mutex_unlock(&mutexout);}; void LockMutex() { g_mutex_lock(&mutex);}; void UnLockMutex() { g_mutex_unlock(&mutex);}; // // Object functions void SetObjectSize (int neww, int newh); void SetObject (VideoFrame objFrame, int newx, int newy); void GetObjectPos (int *x, int *y); void Thread(); }; #endif