Go to the documentation of this file.
14 #include <Eigen/Dense>
26 return {arr[0], arr[1]};
34 [[nodiscard]]
auto contains(Eigen::Vector2i
const& obs,
int border = 0) const
37 Eigen::Vector2f const& obs,
float border = 0.f) const ->
bool;
39 Eigen::Vector2d const& obs,
double border = 0.0) const ->
bool;
41 [[nodiscard]] auto
isEmpty() const ->
bool {
49 [[nodiscard]]
auto iwidth() const ->
int {
return this->
width; }
60 template <
class TPixel>
66 Eigen::Vector2i(border, border),
68 image_size.width - border - 1, image_size.height - border - 1));
72 auto operator==(ImageSize
const& lhs, ImageSize
const& rhs) -> bool;
74 auto operator!=(ImageSize
const& lhs, ImageSize
const& rhs) -> bool;
78 auto half(ImageSize size) -> ImageSize;
81 auto operator<(ImageSize
const& lhs, ImageSize
const& rhs) -> bool;
84 auto operator<<(std::ostream& os, ImageSize
const& image_size) -> std::ostream&;
auto half(ImageSize image_size) -> ImageSize
If the original width [height] is odd, the new width [height] will be: (width+1)/2 [height+1)/2].
Definition: image_size.cpp:29
Image MutImage, owning images types.
Definition: num_diff.h:20
auto operator<(ImageSize const &lhs, ImageSize const &rhs) -> bool
Ordering operator, for keys in sets and maps.
Definition: image_size.cpp:41
static auto from(Eigen::Array2< int > const &arr) -> ImageSize
Definition: image_size.h:25
static auto fromMinMax(TPoint const &min, TPoint const &max) noexcept -> Region< TPoint >
Creates Region from two points, min and max.
Definition: region.h:104
auto array() const -> Eigen::Array2< int >
Definition: image_size.h:45
auto iwidth() const -> int
Definition: image_size.h:49
auto operator!=(ImageSize const &lhs, ImageSize const &rhs) -> bool
Definition: image_size.cpp:37
auto isEmpty() const -> bool
Definition: image_size.h:41
auto imageCoordsInterval(ImageSize image_size, int border=0) -> Region2I
Definition: image_size.h:61
auto operator==(Region< TT > const &lhs, Region< TT > const &rhs) -> bool
Definition: region.h:367
ImageSize(int width, int height)
Definition: image_size.h:23
int height
Vertical height of images, i.e. number of rows.
Definition: image_size.h:56
int width
Horizontal width of images, i.e. number of columns.
Definition: image_size.h:53
auto iheight() const -> int
Definition: image_size.h:50
auto area() const -> size_t
Definition: image_size.h:29
auto operator<<(std::ostream &os, ImageSize const &image_size) -> std::ostream &
Ostream operator.
Definition: image_size.cpp:46
Image size, hence its width and height.
Definition: image_size.h:21
auto contains(Eigen::Vector2i const &obs, int border=0) const -> bool
Returns true if obs is within image.
Definition: image_size.cpp:13
A region is a closed interval [a, b] with a being the lower bound (=min) and b being the upper bound ...
Definition: region.h:19