00001 /*!@file Media/MediaSimEvents.C 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.C $ 00035 // $Id: MediaSimEvents.C 14286 2010-12-01 17:46:34Z sophie $ 00036 // 00037 00038 #include "Media/MediaSimEvents.H" 00039 #include "Transport/FrameOstream.H" 00040 #include "Util/sformat.H" 00041 00042 // ###################################################################### 00043 SimEventInputFrame::SimEventInputFrame(SimModule* src, 00044 const GenericFrame& fram, 00045 const int framenum) : 00046 SimEvent(src), itsFrame(fram), itsFrameNum(framenum) 00047 { } 00048 00049 SimEventInputFrame::~SimEventInputFrame() 00050 { } 00051 00052 std::string SimEventInputFrame::toString() const 00053 { 00054 return SimEvent::toString() + 00055 sformat(", frame=%06d (%dx%d)[%s]", itsFrameNum, 00056 itsFrame.getDims().w(), itsFrame.getDims().h(), 00057 itsFrame.nativeTypeName().c_str()); 00058 } 00059 00060 const GenericFrame& SimEventInputFrame::frame() const 00061 { return itsFrame; } 00062 00063 int SimEventInputFrame::frameNum() const 00064 { return itsFrameNum; } 00065 00066 // ###################################################################### 00067 SimEventRequestSaveOutput::SimEventRequestSaveOutput(SimModule* src) : 00068 SimEvent(src) 00069 { } 00070 00071 SimEventRequestSaveOutput::~SimEventRequestSaveOutput() 00072 { } 00073 00074 // ###################################################################### 00075 SimEventUserInput::SimEventUserInput(SimModule* src, const char* wname, const Point2D<int> clickLoc, const int key) : 00076 SimEvent(src), 00077 itsWname(wname), 00078 itsClick(clickLoc), 00079 itsKey(key) 00080 { } 00081 00082 SimEventUserInput::~SimEventUserInput() 00083 { } 00084 00085 const char* SimEventUserInput::getWinName() const 00086 { 00087 return itsWname; 00088 } 00089 Point2D<int> SimEventUserInput::getMouseClick() const 00090 { 00091 return itsClick; 00092 } 00093 int SimEventUserInput::getKey() const 00094 { 00095 return itsKey; 00096 } 00097 00098 00099 // ###################################################################### 00100 SimEventInputDescription::SimEventInputDescription(SimModule* src, const FrameRange range, const std::string name) : 00101 SimEvent(src), 00102 itsFrameRange(range), 00103 itsName(name) 00104 { } 00105 00106 SimEventInputDescription::~SimEventInputDescription() 00107 { } 00108 00109 FrameRange SimEventInputDescription::getFrameRange() const 00110 { 00111 return itsFrameRange; 00112 } 00113 00114 std::string SimEventInputDescription::getName() const 00115 { 00116 return itsName; 00117 } 00118 00119 // ###################################################################### 00120 SimEventRequestFrameNum::SimEventRequestFrameNum(SimModule* src, const int frameNum) : 00121 SimEvent(src), 00122 itsFrameNum(frameNum) 00123 { } 00124 00125 SimEventRequestFrameNum::~SimEventRequestFrameNum() 00126 { } 00127 00128 int SimEventRequestFrameNum::getFrameNum() const 00129 { 00130 return itsFrameNum; 00131 } 00132 00133 // ###################################################################### 00134 SimEventSceneDescription::SimEventSceneDescription(SimModule* src, 00135 const rutz::shared_ptr<TestImages::SceneData> sceneData): 00136 SimEvent(src), itsSceneData(sceneData) 00137 { } 00138 00139 SimEventSceneDescription::~SimEventSceneDescription() 00140 { } 00141 00142 rutz::shared_ptr<TestImages::SceneData> SimEventSceneDescription::getSceneData() const 00143 { 00144 return itsSceneData; 00145 } 00146 00147 // ###################################################################### 00148 SimEventObjectDescription::SimEventObjectDescription(SimModule* src, 00149 const rutz::shared_ptr<TestImages::ObjData> objData): 00150 SimEvent(src), itsObjData(objData) 00151 { } 00152 00153 SimEventObjectDescription::~SimEventObjectDescription() 00154 { } 00155 00156 rutz::shared_ptr<TestImages::ObjData> SimEventObjectDescription::getObjData() const 00157 { 00158 return itsObjData; 00159 } 00160 00161 // ###################################################################### 00162 SimEventITOutput::SimEventITOutput(SimModule* src, 00163 const rutz::shared_ptr<TestImages::ObjData> objData): 00164 SimEvent(src), itsObjData(objData) 00165 { } 00166 00167 SimEventITOutput::~SimEventITOutput() 00168 { } 00169 00170 rutz::shared_ptr<TestImages::ObjData> SimEventITOutput::getObjData() const 00171 { 00172 return itsObjData; 00173 } 00174 00175 00176 // ###################################################################### 00177 /* So things look consistent in everyone's emacs... */ 00178 /* Local Variables: */ 00179 /* mode: c++ */ 00180 /* indent-tabs-mode: nil */ 00181 /* End: */