00001 /*!@file Parallel/SingleChannelBeoServer.H server to work with SingleChannelBeo */ 00002 00003 // //////////////////////////////////////////////////////////////////// // 00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2003 // 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/Parallel/SingleChannelBeoServer.H $ 00035 // $Id: SingleChannelBeoServer.H 6988 2006-08-11 17:15:38Z rjpeters $ 00036 // 00037 00038 #ifndef SINGLECHANNELBEOSERVER_H_DEFINED 00039 #define SINGLECHANNELBEOSERVER_H_DEFINED 00040 00041 #include "Component/ModelComponent.H" 00042 #include "Component/ModelParam.H" 00043 #include "Util/Types.H" 00044 #include "rutz/shared_ptr.h" 00045 00046 class Beowulf; 00047 class SingleChannel; 00048 00049 //! Server to work with SingleChannelBeo 00050 /*! This class receives images from SingleChannelBeo, process them, 00051 and return the pyramids and submaps back. One server may serve 00052 several SingleChannelBeo clients; messages will be processed 00053 according to the Beowulf node number of the client. The first thing 00054 the client should do is to sent a configuration message, according 00055 to which we will build the channel here. Then, the client may send 00056 input images, which we will process, and we will return the 00057 resulting pyramid and maps. 00058 00059 The system can work in two modes: in full emulation mode, the output 00060 map, channel pyramid, submaps and clip pyramid are all returned by 00061 the processor node. This requires a lot of network bandwidth but 00062 should ensure results that are exactly identical to when using the 00063 normal channels. In quick mode, only the output submap is 00064 returned. This will work with standard processing that only deals 00065 with the output, but things like saving the submaps or biasing the 00066 visual cortex will break; so use the fast mode at your own risk ;-) 00067 Selection of which mode is used is done via opur itsQuickMode 00068 ModelParam. */ 00069 00070 class SingleChannelBeoServer : public ModelComponent 00071 { 00072 public: 00073 //! Constructor 00074 SingleChannelBeoServer(OptionManager& mgr, 00075 const std::string& descrName = 00076 "SingleChannelBeo Server", 00077 const std::string& tagName = 00078 "SingleChannelBeoServer"); 00079 00080 //! Destructor 00081 virtual ~SingleChannelBeoServer(); 00082 00083 //! Call this often for us to do our work 00084 void check(); 00085 00086 protected: 00087 OModelParam<bool> itsQuickMode; //!< only send off output map, not other maps 00088 00089 private: 00090 // our Beowulf for message passing 00091 nub::soft_ref<Beowulf> itsBeo; 00092 00093 // find the channel for given node, or NULL if no channel for it yet: 00094 nub::soft_ref<SingleChannel> channel(const int32 node); 00095 }; 00096 00097 #endif 00098 00099 // ###################################################################### 00100 /* So things look consistent in everyone's emacs... */ 00101 /* Local Variables: */ 00102 /* indent-tabs-mode: nil */ 00103 /* End: */