core
vpgl
vpgl_camera.h
Go to the documentation of this file.
1
// This is core/vpgl/vpgl_camera.h
2
#ifndef vpgl_camera_h_
3
#define vpgl_camera_h_
4
//:
5
// \file
6
// \brief A general camera class.
7
// \author Thomas Pollard
8
// \date January 28, 2005
9
// \author Joseph Mundy, Matt Leotta, Vishal Jain
10
//
11
// A basic abstract camera class on which all specific cameras are based.
12
// As such there is only one operation it performs:
13
// project a 3d world point into a 2d image point. The class is templated
14
// over T which had better be an algebraic field. Since camera operations are
15
// based on projective geometry, it could be that case that T is complex
16
// in order to account for projecting quadric surfaces.
17
//
18
// \verbatim
19
// Modifications
20
// October 26, 2006 - Moved homogeneous methods to projective camera, since
21
// projective geometry may not apply in the most general case, e.g. rational cameras. - JLM
22
// \endverbatim
23
24
#include <string>
25
#ifdef _MSC_VER
26
# include <vcl_msvc_warnings.h>
27
#endif
28
#include <
vbl/vbl_ref_count.h
>
29
30
template
<
class
T>
31
class
vpgl_camera
:
public
vbl_ref_count
32
{
33
public
:
34
35
vpgl_camera
() =
default
;
36
~vpgl_camera
()
override
=
default
;
37
38
//: class identity functions for casting
39
virtual
std::string
type_name
()
const
{
return
"vpgl_camera"
; }
40
std::string
is_a
()
const
{
return
type_name
();}
41
bool
is_class
(std::string
const
& name)
const
{
return
type_name
() == name;}
42
43
//: The generic camera interface. u represents image column, v image row.
44
virtual
void
project
(
const
T x,
const
T y,
const
T z, T& u, T& v)
const
= 0;
45
};
46
47
// convenience typedefs for smart pointers to abstract cameras
48
#include "
vpgl_camera_double_sptr.h
"
49
#include "
vpgl_camera_float_sptr.h
"
50
51
#endif // vpgl_camera_h_
vpgl_camera_double_sptr.h
vpgl_camera::is_class
bool is_class(std::string const &name) const
Definition:
vpgl_camera.h:41
vpgl_camera::~vpgl_camera
~vpgl_camera() override=default
vpgl_camera
Definition:
vpgl_camera.h:31
vpgl_camera_float_sptr.h
vpgl_camera::vpgl_camera
vpgl_camera()=default
vpgl_camera::is_a
std::string is_a() const
Definition:
vpgl_camera.h:40
vpgl_camera::type_name
virtual std::string type_name() const
class identity functions for casting.
Definition:
vpgl_camera.h:39
vpgl_camera::project
virtual void project(const T x, const T y, const T z, T &u, T &v) const =0
The generic camera interface. u represents image column, v image row.
vbl_ref_count.h
vbl_ref_count
Generated by
1.8.15