BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
6a2a2ad
Branches
Tags
master
Blinker
src
noarch
CanvasInput.h
changed canvas to be able to copy any rectangular region from inputs to canvas
Stefan Schuermans
commited
6a2a2ad
at 2011-11-19 14:28:08
CanvasInput.h
Blame
History
Raw
/* Blinker Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef CANVASINPUT_H #define CANVASINPUT_H #include <string> #include <BlinkenLib/BlinkenFrame.h> #include "Canvas.h" #include "Directory.h" #include "File.h" #include "Position.h" #include "SettingFile.h" #include "Size.h" #include "StreamMgr.h" #include "StreamRecv.h" namespace Blinker { /// input to canvas class Canvas::Input: public StreamRecv { public: /** * @brief constructor * @param[in] canvas owning canvas * @param[in] dirBase base directory */ Input(Canvas &canvas, const Directory &dirBase); /// virtual destructor virtual ~Input(); private: /// copy constructor disabled Input(const Input &that); /// assignment operator disabled const Input & operator=(const Input &that); public: /// check for update of configuration void updateConfig(); /** * @brief set current frame * @param[in] stream stream name * @param[in] pFrame current frame */ virtual void setFrame(const std::string &stream, stBlinkenFrame *pFrame); /** * @brief set current frame to none * @param[in] stream stream name */ virtual void setNoFrame(const std::string &stream); /** * @brief draw current frame to canvas * @return if a frame was available and it was drawn */ bool draw(); protected: /// get input stream and attach to it void getInStream(); /// detach from input stream and release it void releaseInStream(); /// (re-)get position of area to copy from stream void getSrcPos(); /// (re-)get size of area to copy from stream void getSize(); /// (re-)get destination position on canvas void getDestPos(); protected: Canvas &m_canvas; ///< owning canvas SettingFile m_fileInStream; ///< input stream name file SettingFile m_fileSrcPos; ///< source position file SettingFile m_fileSize; ///< size file SettingFile m_fileDestPos; ///< destination position file std::string m_nameInStream; ///< name of input stream Stream *m_pInStream; ///< input stream bool m_haveSrcPos; ///< if copy-area src position is defined Position m_srcPos; ///< copy-area position in source bool m_haveSize; ///< if copy-area size is defined Size m_size; ///< copy-area size bool m_haveDestPos; ///< if copy-area dest position is defined Position m_destPos; ///< copy-area position on canvas (i.e. dest) }; // class Canvas::Input } // namespace Blinker #endif // #ifndef CANVASINPUT_H