
00001 /*!@file Media/MediaSimEvents.H SimEvent derivatives for media modules */ 00002 00003 // //////////////////////////////////////////////////////////////////// // 00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2005 // 00005 // by the University of Southern California (USC) and the iLab at USC. // 00006 // See http://iLab.usc.edu for information about this project. // 00007 // //////////////////////////////////////////////////////////////////// // 00008 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00009 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00010 // in Visual Environments, and Applications'' by Christof Koch and // 00011 // Laurent Itti, California Institute of Technology, 2001 (patent // 00012 // pending; application number 09/912,225 filed July 23, 2001; see // 00013 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00014 // //////////////////////////////////////////////////////////////////// // 00015 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00016 // // 00017 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00018 // redistribute it and/or modify it under the terms of the GNU General // 00019 // Public License as published by the Free Software Foundation; either // 00020 // version 2 of the License, or (at your option) any later version. // 00021 // // 00022 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00023 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00024 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00025 // PURPOSE. See the GNU General Public License for more details. // 00026 // // 00027 // You should have received a copy of the GNU General Public License // 00028 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00029 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00030 // Boston, MA 02111-1307 USA. // 00031 // //////////////////////////////////////////////////////////////////// // 00032 // 00033 // Primary maintainer for this file: Laurent Itti <itti@usc.edu> 00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Media/MediaSimEvents.H $ 00035 // $Id: MediaSimEvents.H 10954 2009-02-28 19:37:18Z lior $ 00036 // 00037 00038 #ifndef MEDIA_MEDIASIMEVENTS_H_DEFINED 00039 #define MEDIA_MEDIASIMEVENTS_H_DEFINED 00040 00041 #include "Raster/GenericFrame.H" 00042 #include "Simulation/SimEvent.H" 00043 #include "Transport/FrameInfo.H" 00044 #include "Media/TestImages.H" 00045 class FrameOstream; 00046 00047 // ###################################################################### 00048 //! A new input frame is available 00049 /*! InputFrameSeries posts this event each time a new input frame has 00050 become available. */ 00051 class SimEventInputFrame : public SimEvent { 00052 public: 00053 //! Constuctor 00054 SimEventInputFrame(SimModule* src, 00055 const GenericFrame& fram, 00056 const int framenum); 00057 00058 //! Destructor 00059 virtual ~SimEventInputFrame(); 00060 00061 //! Get a description for printing out 00062 virtual std::string toString() const; 00063 00064 //! Get the frame 00065 const GenericFrame& frame() const; 00066 00067 //! Get the frame number 00068 int frameNum() const; 00069 00070 private: 00071 const GenericFrame itsFrame; 00072 const int itsFrameNum; 00073 }; 00074 00075 // ###################################################################### 00076 //! Request that outputs be saved now 00077 /*! Normally, SimOutputFrameSeries will save outputs at a fixed 00078 rate. However, it can also operate in an event-driven mode if a 00079 framerate has not been specified on the command line. SimModule 00080 objects may post SimEventSaveOutput events each time they generate 00081 events which they think warrant saving the outputs should the output 00082 frame series operate in event-driven mode. Any SimEventSaveOutput 00083 will be ignored if the output frame series is operating at a fixed 00084 framerate. An example is that when WinnerTakeAll has a new covert 00085 shift of attention, it will post a SimEventSaveOutput. */ 00086 class SimEventRequestSaveOutput : public SimEvent { 00087 public: 00088 //! Constuctor 00089 SimEventRequestSaveOutput(SimModule* src); 00090 00091 //! Destructor 00092 virtual ~SimEventRequestSaveOutput(); 00093 }; 00094 00095 // ###################################################################### 00096 //! Send the user mouse and keyboard events 00097 class SimEventUserInput : public SimEvent { 00098 public: 00099 //! Constuctor 00100 SimEventUserInput(SimModule* src, const char* wname, const Point2D<int> clickLoc, const int key); 00101 00102 //! Destructor 00103 virtual ~SimEventUserInput(); 00104 00105 //! get the window name that generated the event 00106 const char* getWinName() const; 00107 00108 //! Get the mouse event 00109 Point2D<int> getMouseClick() const; 00110 00111 //! get the keyboard input 00112 int getKey() const; 00113 00114 private: 00115 const char* itsWname; 00116 const Point2D<int> itsClick; 00117 const int itsKey; 00118 00119 }; 00120 00121 // ###################################################################### 00122 //! A Description of the scene 00123 /*! Any module can use this event to post knowledge of the scene. For example gist recognition 00124 can determine the scene type and post this event. */ 00125 class SimEventSceneDescription : public SimEvent { 00126 public: 00127 //! Constuctor 00128 SimEventSceneDescription(SimModule* src, 00129 const rutz::shared_ptr<TestImages::SceneData> sceneData); 00130 00131 //! Destructor 00132 virtual ~SimEventSceneDescription(); 00133 00134 rutz::shared_ptr<TestImages::SceneData> getSceneData() const; 00135 private: 00136 rutz::shared_ptr<TestImages::SceneData> itsSceneData; 00137 }; 00138 00139 // ###################################################################### 00140 //! A Description of an object 00141 /*! Any module can use this event to post knowledge of an object. For example IT 00142 can determine the object type and post this event. */ 00143 class SimEventObjectDescription : public SimEvent { 00144 public: 00145 //! Constuctor 00146 SimEventObjectDescription(SimModule* src, 00147 const rutz::shared_ptr<TestImages::ObjData> objData); 00148 00149 //! Destructor 00150 virtual ~SimEventObjectDescription(); 00151 00152 rutz::shared_ptr<TestImages::ObjData> getObjData() const; 00153 private: 00154 rutz::shared_ptr<TestImages::ObjData> itsObjData; 00155 }; 00156 00157 00158 // ###################################################################### 00159 /* So things look consistent in everyone's emacs... */ 00160 /* Local Variables: */ 00161 /* mode: c++ */ 00162 /* indent-tabs-mode: nil */ 00163 /* End: */ 00164 00165 #endif // MEDIA_MEDIASIMEVENTS_H_DEFINED
1.4.4