mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
depth_image_camera.h
Go to the documentation of this file.
1 #ifndef MF_DEPTH_IMAGE_CAMERA_H_
2 #define MF_DEPTH_IMAGE_CAMERA_H_
3 
4 #include "image_camera.h"
5 #include <limits>
6 #include <type_traits>
7 
8 namespace mf {
9 
11 template<typename Depth>
13  static_assert(std::is_integral<Depth>::value, "Depth must be integer type");
14 
15 private:
16  real depth_origin_ = 0.0;
17  real depth_range_ = +1.0;
18  real pixel_depth_minimum_ = static_cast<real>(std::numeric_limits<Depth>::min());
19  real pixel_depth_maximum_ = static_cast<real>(std::numeric_limits<Depth>::max());
20 
21 public:
22  using pixel_depth_type = Depth;
23 
24  depth_image_camera() = default;
25  depth_image_camera(const ndsize<2>& image_size, real origin, real range) :
26  image_camera(image_size), depth_origin_(origin), depth_range_(range) { }
27 
29  bool in_depth_bounds(real d) const;
30 
32 
34 
36 
38 
40 
41  real to_depth(pixel_depth_type pixd) const;
42 };
43 
44 }
45 
46 #include "depth_image_camera.tcc"
47 
48 #endif
float real
Real number type.
Definition: common.h:48
Depth pixel_depth_type
Pixel depth value integer type.
Definition: depth_image_camera.h:22
pixel_depth_type to_pixel_depth_clamp(real d) const
Map depth value to pixel depth value, and clamp to bounds.
Definition: depth_image_camera.tcc:18
const ndsize< 2 > & image_size() const
Definition: image_camera.h:31
bool in_depth_bounds(real d) const
Verifies whether d is in bounds of valid depth values.
Definition: depth_image_camera.tcc:4
Camera which handles mapping to image coordinates, base class.
Definition: image_camera.h:16
pixel_depth_type to_pixel_depth(real d) const
Map depth value to pixel depth value.
Definition: depth_image_camera.tcc:10
real to_depth(pixel_depth_type pixd) const
Map pixel depth value to depth value in range defined by depth projection parameter.
Definition: depth_image_camera.tcc:32
Depth camera which handles mapping to integer depth values, base class.
Definition: depth_image_camera.h:12
Vector of n-dimensional coordinates.
Definition: ndcoord.h:18
depth_image_camera(const ndsize< 2 > &image_size, real origin, real range)
Definition: depth_image_camera.h:25
depth_image_camera()=default