libeblearntools
/home/rex/ebltrunk/tools/libeblearntools/include/camera_kinect.h
00001 /***************************************************************************
00002  *   Copyright (C) 2010 by Soumith Chintala and Pierre Sermanet  *
00003  *   chin@nyu.edu, sermanet@cs.nyu.edu   *
00004  *   All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Redistribution under a license not approved by the Open Source 
00014  *       Initiative (http://www.opensource.org) must display the 
00015  *       following acknowledgement in all advertising material:
00016  *        This product includes software developed at the Courant
00017  *        Institute of Mathematical Sciences (http://cims.nyu.edu).
00018  *     * The names of the authors may not be used to endorse or promote products
00019  *       derived from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
00022  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00023  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00024  * DISCLAIMED. IN NO EVENT SHALL ThE AUTHORS BE LIABLE FOR ANY
00025  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00026  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00027  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00028  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00029  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00030  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  ***************************************************************************/
00032 
00033 
00034 #ifndef CAMERA_KINECT_H_
00035 #define CAMERA_KINECT_H_
00036 
00037 #include "camera.h"
00038 
00039 using namespace std;
00040 
00041 namespace ebl {
00042 
00047   //TODO: also add interface to grab RGB image(simple but haven't done yet)
00048   template <typename Tdata> class camera_kinect : public camera<Tdata> {
00049   public:
00050 
00052     // constructors/allocation
00053 
00061     camera_kinect(int height = -1, int width = -1,
00062                   std::ostream &out = std::cout,
00063                   std::ostream &err = std::cerr);
00064 
00066     virtual ~camera_kinect();
00067 
00069     // frame grabbing
00070 
00072     virtual idx<Tdata> grab();
00073 
00074     // members ////////////////////////////////////////////////////////
00075   protected:
00076     using camera<Tdata>::frame;         
00077     using camera<Tdata>::frame_id_;     
00078     using camera<Tdata>::grabbed;       
00079     using camera<Tdata>::height;        
00080     using camera<Tdata>::width;         
00081     using camera<Tdata>::bresize;       
00082     using camera<Tdata>::mresize;       
00083     using camera<Tdata>::resize_mode;   
00084     using camera<Tdata>::out;   
00085     using camera<Tdata>::err;   
00086   };
00087 
00088 } // end namespace ebl
00089 
00090 #include "camera_kinect.hpp"
00091 
00092 
00093 #endif /* CAMERA_KINECT_H_ */