core/vpgl/vpgl_camera.h
Go to the documentation of this file.
00001 // This is core/vpgl/vpgl_camera.h
00002 #ifndef vpgl_camera_h_
00003 #define vpgl_camera_h_
00004 //:
00005 // \file
00006 // \brief A general camera class.
00007 // \author Thomas Pollard
00008 // \date January 28, 2005
00009 // \author Joseph Mundy, Matt Leotta, Vishal Jain
00010 //
00011 //   A basic abstract camera class on which all specific cameras are based.
00012 //   As such there is only one operation it performs:
00013 //   project a 3d world point into a 2d image point.  The class is templated
00014 //   over T which had better be an algebraic field. Since camera operations are
00015 //   based on projective geometry, it could be that case that T is complex
00016 //   in order to account for projecting quadric surfaces.
00017 //
00018 // \verbatim
00019 //  Modifications
00020 //   October 26, 2006 - Moved homogeneous methods to projective camera, since
00021 //                      projective geometry may not apply in the most general case, e.g. rational cameras. - JLM
00022 // \endverbatim
00023 
00024 #include <vcl_string.h>
00025 #include <vbl/vbl_ref_count.h>
00026 
00027 template <class T>
00028 class vpgl_camera : public vbl_ref_count
00029 {
00030  public:
00031 
00032   vpgl_camera() {}
00033   virtual ~vpgl_camera() {}
00034 
00035   //: class identity functions for casting
00036   virtual vcl_string type_name() const { return "vpgl_camera"; }
00037   vcl_string is_a() const {return type_name();}
00038   bool is_class(vcl_string const& name) const {return type_name() == name;}
00039 
00040   //: The generic camera interface. u represents image column, v image row.
00041   virtual void project(const T x, const T y, const T z, T& u, T& v) const = 0;
00042 };
00043 
00044 // convenience typedefs for smart pointers to abstract cameras
00045 #include "vpgl_camera_double_sptr.h"
00046 #include "vpgl_camera_float_sptr.h"
00047 
00048 #endif // vpgl_camera_h_