/** * @class vetFilterSample * * @brief * * * * * @bug * @warning * @todo * * @see vetFilter * * @version 1.0 * @date 19/01/2006 17.27.37 * @author Alessandro Polo * * **************************************************************************** * VETLib Framework 1.02 * Copyright (C) Alessandro Polo 2005 * http://www.ewgate.net/vetlib * ****************************************************************************/ #ifndef __VETLIB_VETFILTERSAMPLE_H__ #define __VETLIB_VETFILTERSAMPLE_H__ #include "H:\eCenter\UNI\TESI\source\vetFilter.h" class vetFilterSampleParameters : public vetFilterParameters { public: enum RUNMODE{ DO_NOTHING, ROTATE90, FLIP }; protected: RUNMODE runMode; friend class vetFilterSample; public: vetFilterSampleParameters(); ~vetFilterSampleParameters() {}; void reset(); /** * @brief Serialize class to XML format. * Class' tag is * * @param[in] fp output stream's pointer * * @return VETRET_OK if everything is fine, VETRET_INTERNAL_ERR else. */ VETRESULT saveToStreamXML(FILE *fp); /** * @brief Deserialize class from XML format. * Class' tag must be * * @param[in] fp input stream's pointer * * @return VETRET_OK if everything is fine, VETRET_INTERNAL_ERR else. */ VETRESULT loadFromStreamXML(FILE *fp); }; class vetFilterSample : public vetFilter { protected: /** * @brief Current parameters. */ vetFilterSampleParameters* myParams; public: /** * @brief Default constructor, initialize parameters and superclasses. * @param[in] initParams parameters for this module or NULL for defaults. */ vetFilterSample(vetFilterSampleParameters* initParams = NULL ); /** * @brief Default destructor, free buffer. */ ~vetFilterSample(); /** * @brief Set parameters for this filter. * * @param[in] initParams Instance of vetFilterSampleParameters or NULL, * NULL argument make function to create a new * instance with default parameters. * * @return VETRET_OK */ VETRESULT setParameters(vetFilterSampleParameters* initParams); /** * @brief Get parameters for this filter. * * @return pointer to vetFilterSampleParameters instance. */ vetFilterSampleParameters& getParameters() { return *myParams; }; /** * @brief Set parameters for this filter. * * @param[in] initParams Instance of vetFilterSampleParameters or NULL, * NULL argument make function to create a new * instance with default parameters. * * @return VETRET_OK */ VETRESULT setFilterParameters (vetFilterParameters* initParams) { if (initParams == NULL) return setParameters(NULL); else return setParameters(static_cast(initParams)); }; /** * @brief Get parameters for this filter. * * @return pointer to vetFilterSampleParameters instance. */ vetFilterParameters* getFilterParameters () { if (myParams == NULL) return NULL; else return static_cast(myParams); }; /** * @brief Reset buffers and parameters. * * @return VETRET_OK */ VETRESULT reset(); static VETRESULT rotate90(vetFrameYUV420& dest, vetFrameYUV420& source); static VETRESULT rotate90(vetFrameRGB24& dest, vetFrameRGB24& source); static VETRESULT rotate90(vetFrameT& dest, vetFrameT& source); /** * @brief Process the frame with current settings and store in buffer. * * @param[in] img VETLib Cache Frame to be processed. * * @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 Process the frame with current settings and store in buffer. * * @param[in] img VETLib Cache24 Frame to be processed. * * @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 Process the frame with current settings and store in buffer. * * @param[in] img VETLib Grayscale Frame to be processed. * * @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_VETFILTERSAMPLE_H__