mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
projection_view_frustum.h
Go to the documentation of this file.
1 #ifndef MF_PROJECTION_VIEW_FRUSTUM_H_
2 #define MF_PROJECTION_VIEW_FRUSTUM_H_
3 
4 #include "view_frustum.h"
5 #include "angle.h"
6 #include "../eigen.h"
7 #include <utility>
8 #include <array>
9 
10 namespace mf {
11 
12 
14 
17 private:
19  view_frustum(mat, conv) { }
20 
21  static std::array<real, 3> depth_components_(const depth_projection_parameters&);
22 
23 public:
24  using distance_pair = std::pair<real, real>;
25  using angle_pair = std::pair<angle, angle>;
26 
29  (real near_width, real near_height, const depth_projection_parameters&);
30 
33  (angle near_width, angle near_height, const depth_projection_parameters&);
34 
37  (angle near_width, real aspect_ratio, const depth_projection_parameters&);
38 
41  (angle near_height, real aspect_ratio, const depth_projection_parameters&);
42 
46 
49  (angle_pair near_x, angle_pair near_y, const depth_projection_parameters&);
50 
53  }
54 
55  real aspect_ratio() const;
56  bool is_symmetric_x() const;
57  bool is_symmetric_y() const;
58  bool is_symmetric() const;
59 
62 };
63 // TODO add orthogonal projection if needed
64 
65 }
66 
67 #endif
float real
Real number type.
Definition: common.h:48
static projection_view_frustum symmetric_perspective_fov_x(angle near_width, real aspect_ratio, const depth_projection_parameters &)
Create with symmetric perspective, given horizontal field of view and image aspect ratio...
Definition: projection_view_frustum.cc:74
Parameters of Z to depth projection.
Definition: depth_projection_parameters.h:12
static projection_view_frustum symmetric_perspective_fov(angle near_width, angle near_height, const depth_projection_parameters &)
Create with symmetric perspective, given horizontal and vertical field of view angles.
Definition: projection_view_frustum.cc:59
void adjust_fov_y_to_aspect_ratio(real aspect_ratio)
Definition: projection_view_frustum.cc:159
const Eigen_projective3 & projection_transformation() const
Definition: projection_view_frustum.h:51
real aspect_ratio() const
Definition: projection_view_frustum.cc:134
static projection_view_frustum asymmetric_perspective(distance_pair near_x, distance_pair near_y, const depth_projection_parameters &)
Create with asymmetric perspective, given horizontal and vertical ranges of near clipping plane...
Definition: projection_view_frustum.cc:108
void adjust_fov_x_to_aspect_ratio(real aspect_ratio)
Definition: projection_view_frustum.cc:154
bool is_symmetric_y() const
Definition: projection_view_frustum.cc:144
bool is_symmetric_x() const
Definition: projection_view_frustum.cc:139
View frustum of a perspective camera.
Definition: view_frustum.h:18
std::pair< real, real > distance_pair
Definition: projection_view_frustum.h:24
static projection_view_frustum asymmetric_perspective_fov(angle_pair near_x, angle_pair near_y, const depth_projection_parameters &)
Create with asymmetric perspective, given horizontal and vertical limit angles of field of view...
Definition: projection_view_frustum.cc:126
bool is_symmetric() const
Definition: projection_view_frustum.cc:149
Eigen::Transform< Eigen_scalar, 3, Eigen::Projective > Eigen_projective3
Definition: eigen.h:40
std::pair< angle, angle > angle_pair
Definition: projection_view_frustum.h:25
View frustum of a perspective camera, without pose.
Definition: projection_view_frustum.h:16
Angle, represented in radiants.
Definition: angle.h:12
view_frustum()=delete
const Eigen_projective3 & view_projection_transformation() const
Definition: view_frustum.h:43
static projection_view_frustum symmetric_perspective_fov_y(angle near_height, real aspect_ratio, const depth_projection_parameters &)
Create with symmetric perspective, given vertical field of view and image aspect ratio.
Definition: projection_view_frustum.cc:91
Eigen_mat< 4, 4 > Eigen_mat4
Definition: eigen.h:30
static projection_view_frustum symmetric_perspective(real near_width, real near_height, const depth_projection_parameters &)
Create with symmetric perspective, given width and height of near clipping plane. ...
Definition: projection_view_frustum.cc:41