22 #ifndef SIRIUS_TYPES_H_ 23 #define SIRIUS_TYPES_H_ 42 Size(
const std::array<int, 2>& size);
67 result.
row = std::ceil(result.
row * scale);
68 result.
col = std::ceil(result.
col * scale);
73 *
this = *
this * scale;
146 return input_resolution_ /
static_cast<double>(output_resolution_);
157 int input_resolution_{1};
158 int output_resolution_{1};
163 #endif // SIRIUS_TYPES_H_
Definition: exception.h:27
ZoomRatio()=default
Instantiate a zoom ratio 1:1.
std::vector< double > Buffer
Definition: types.h:33
bool operator==(const Size &rhs) const
Definition: types.h:54
Data class that represents the 2D coordinates of a point.
Definition: types.h:86
int input_resolution() const
Definition: types.h:141
ZoomRatio & operator=(const ZoomRatio &)=default
bool operator<(const Size &rhs) const
Definition: types.h:50
Data class that represents zoom ratio as input_resolution/output_resolution.
Definition: types.h:105
int CellCount() const
Definition: types.h:77
int x
Definition: types.h:97
int y
Definition: types.h:98
Size & operator*=(int scale)
Definition: types.h:72
Data class that represents the size of an image.
Definition: types.h:38
Size operator*(double scale) const
Definition: types.h:65
Size operator*(int scale) const
Definition: types.h:58
Point & operator=(const Point &)=default
int row
Definition: types.h:79
static ZoomRatio Create(const std::string &ratio_string)
Create an instance from a formatted string (input_resolution:output_resolution)
Size & operator=(const Size &)=default
int col
Definition: types.h:80
constexpr Point(int x, int y) noexcept
Definition: types.h:89
int output_resolution() const
Definition: types.h:143
double ratio() const
Definition: types.h:145