1 #ifndef MF_IMAGE_CAMERA_H_
2 #define MF_IMAGE_CAMERA_H_
8 #include "../ndarray/ndspan.h"
19 bool flipped_ =
false;
49 auto x =
static_cast<real>(pix[0]) + 0.5;
50 auto y =
static_cast<real>(pix[1]) + 0.5;
55 auto x =
static_cast<std::ptrdiff_t
>(im[0] - 0.5);
56 auto y =
static_cast<std::ptrdiff_t
>(im[1] - 0.5);
Eigen_vec2 image_coordinates_type
2D image coordinates, range and scale defined by subclass.
Definition: camera.h:25
float real
Real number type.
Definition: common.h:48
image_camera(const ndsize< 2 > &)
Definition: image_camera.cc:5
const ndsize< 2 > & image_size() const
Definition: image_camera.h:31
ndspan< 2 > image_span() const
Definition: image_camera.h:44
Camera which handles mapping to image coordinates, base class.
Definition: image_camera.h:16
bool pixel_coordinates_flipped() const
Definition: image_camera.h:34
void set_image_width(std::size_t)
Set image width, and adjust height to keep same aspect ratio.
Definition: image_camera.cc:14
typename camera::image_coordinates_type image_coordinates_type
Definition: image_camera.h:26
Vector of n-dimensional coordinates.
Definition: ndcoord.h:18
image_coordinates_type to_image(pixel_coordinates_type pix) const
Definition: image_camera.h:48
Cuboid n-dimensional span delimited by two ndcoord vectors.
Definition: ndspan.h:15
real image_aspect_ratio() const
Definition: image_camera.cc:9
pixel_coordinates_type to_pixel(image_coordinates_type im) const
Definition: image_camera.h:54
auto make_ndptrdiff(Components...c)
Definition: ndcoord.h:192
void set_image_height(std::size_t)
Set image height, and adjust width to keep same aspect ratio.
Definition: image_camera.cc:20
std::size_t image_number_of_pixels() const
Definition: image_camera.h:32
void flip_pixel_coordinates()
Definition: image_camera.cc:26