/** * @class vetWindowQT * * @brief Class for displaying VETLib frames on a Linux Desktop Env. * Require Trolltech QT library (included in most distribution) * Inherit QWidget, so may be used in any QAplication without limitations. * May be used to display video, sample applications played at 34 fps. * * @bug Currenlty does a single pixel routine. * @warning Require a main QApplication. * @todo * @note vetWindowQT must be initialized after QApplication. * * @see vetOutput * @example ../../tests/test_vetWindowQT.cpp * @example ../../tests/app_vetLinuxMOVPlayer.cpp * @example ../../tests/app_vetLinuxMPEGPlayer.cpp * @example ../../tests/app_vetVideo4LinuxPlayer.cpp * * @version 1.0.2 * @date 15/09/2005 * @author Alessandro Polo * * **************************************************************************** * VETLib Framework 1.0.2 * Copyright (C) Alessandro Polo 2006 * http://www.ewgate.net/vetlib * ****************************************************************************/ #ifndef __VETLIB_VETWINDOWQT_H__ #define __VETLIB_VETWINDOWQT_H__ #include "../vetDefs.h" #include "../vetOutput.h" #include "../vetFrameYUV420.h" #include "../vetFrameRGB24.h" #include "../vetFrameT.h" //Trolltech QT headers #include #include #include /** * @brief Deafult window's width. */ #define VETWQT_DEF_WIDTH 320 /** * @brief Deafult window's height. */ #define VETWQT_DEF_HEIGHT 240 class vetWindowQT : public vetOutput, public QWidget { protected: /** * @brief QPainter instance, main drawing object. */ QPainter* dataCanvas; /** * @brief Paint Event callback functions for future extensions. * @param[out] event Event raised. */ virtual void paintEvent(QPaintEvent* event) { } public: /** * @brief Default constructor initializes variables. */ vetWindowQT(); /** * @brief Default constructor initializes variables. * * @param[in] width Window's width in pixels. * @param[in] height Window's height in pixels. */ vetWindowQT(unsigned int width, unsigned int height); /** * @brief Set current canvas' height. * * @return height in pixel. */ VETRESULT setHeight(unsigned int value); /** * @brief Set current canvas' width. * * @return width in pixel. */ VETRESULT setWidth(unsigned int value); /** * @brief Currently not used. * @return VETRET_NOT_IMPLEMENTED */ VETRESULT run() { return VETRET_NOT_IMPLEMENTED; }; /** * @brief Display frame, single pixel routine. * * @param[in] img VETLib Cache Frame to be displayed. * * @return VETRET_OK if everything is fine, VETRET_INTERNAL_ERR else. * * @note Input operator (<<) call directly this function. * @see operator << (vetFrameYUV420&) */ VETRESULT importFrom(vetFrameYUV420& img); /** * @brief Display frame, single pixel routine. * * @param[in] img VETLib Cache24 Frame to be displayed. * * @return VETRET_OK if everything is fine, VETRET_INTERNAL_ERR else. * * @note Input operator (<<) call directly this function. * @see operator << (vetFrameRGB24&) */ VETRESULT importFrom(vetFrameRGB24& img); /** * @brief Display frame, single pixel routine. * * @param[in] img VETLib Grey Frame to be displayed. * * @return VETRET_OK if everything is fine, VETRET_INTERNAL_ERR else. * * @note Input operator (<<) call directly this function. * @see operator << (vetFrameT&) */ VETRESULT importFrom(vetFrameT& img); }; #endif //__VETLIB_VETWINDOWQT_H__