00001 /** 00002 \file Robots/LoBot/io/LoImageSource.H 00003 \brief Just a source of images. 00004 */ 00005 00006 // //////////////////////////////////////////////////////////////////// // 00007 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2005 // 00008 // by the University of Southern California (USC) and the iLab at USC. // 00009 // See http://iLab.usc.edu for information about this project. // 00010 // //////////////////////////////////////////////////////////////////// // 00011 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00012 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00013 // in Visual Environments, and Applications'' by Christof Koch and // 00014 // Laurent Itti, California Institute of Technology, 2001 (patent // 00015 // pending; application number 09/912,225 filed July 23, 2001; see // 00016 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00017 // //////////////////////////////////////////////////////////////////// // 00018 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00019 // // 00020 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00021 // redistribute it and/or modify it under the terms of the GNU General // 00022 // Public License as published by the Free Software Foundation; either // 00023 // version 2 of the License, or (at your option) any later version. // 00024 // // 00025 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00026 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00027 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00028 // PURPOSE. See the GNU General Public License for more details. // 00029 // // 00030 // You should have received a copy of the GNU General Public License // 00031 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00032 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00033 // Boston, MA 02111-1307 USA. // 00034 // //////////////////////////////////////////////////////////////////// // 00035 // 00036 // Primary maintainer for this file: Manu Viswanathan <mviswana at usc dot edu> 00037 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Robots/LoBot/io/LoImageSource.H $ 00038 // $Id: LoImageSource.H 11256 2009-05-30 01:46:10Z mviswana $ 00039 // 00040 00041 #ifndef LOBOT_IMAGE_SOURCE_DOT_H 00042 #define LOBOT_IMAGE_SOURCE_DOT_H 00043 00044 //------------------------------ HEADERS -------------------------------- 00045 00046 // lobot headers 00047 #include "Robots/LoBot/misc/LoTypes.H" 00048 00049 // INVT image support 00050 #include "Image/Image.H" 00051 00052 //----------------------------- NAMESPACE ------------------------------- 00053 00054 namespace lobot { 00055 00056 //------------------------- CLASS DEFINITION ---------------------------- 00057 00058 /** 00059 \class lobot::ImageSource 00060 \brief Just a source of Images. 00061 00062 This class serves as an interface for image sources and is meant to be 00063 used by lobot::ImageDrawable and lobot::LocustModel. The 00064 lobot::LocustModel class uses this one via the lobot::InputSource 00065 encapsulation. 00066 */ 00067 template<typename pixel_type> 00068 class ImageSource { 00069 ImageSource(const ImageSource&) ; 00070 ImageSource& operator=(const ImageSource&) ; 00071 00072 protected: 00073 // Each image source will cache the image it retrieves from its 00074 // "upstream" sources. 00075 Image<pixel_type> m_image ; 00076 GrayImage m_image_gray ; 00077 00078 ImageSource() ; 00079 00080 public: 00081 virtual ~ImageSource() ; 00082 virtual void update() = 0 ; 00083 Image<pixel_type> getImage() const {return m_image ;} 00084 GrayImage getImageGray() const {return m_image_gray ;} 00085 virtual Dims getImageSize() const ; 00086 } ; 00087 00088 // Constructor and destructor 00089 template<typename T> 00090 ImageSource<T>::ImageSource(){} 00091 00092 template<typename T> 00093 ImageSource<T>::~ImageSource(){} 00094 00095 // Accessor 00096 template<typename T> 00097 Dims ImageSource<T>::getImageSize() const 00098 { 00099 return m_image.getDims() ; 00100 } 00101 00102 //----------------------------------------------------------------------- 00103 00104 } // end of namespace encapsulating this file's definitions 00105 00106 #endif 00107 00108 /* So things look consistent in everyone's emacs... */ 00109 /* Local Variables: */ 00110 /* indent-tabs-mode: nil */ 00111 /* End: */