3.3.2.31. Class ZoomRatio¶
- Defined in File types.h
3.3.2.31.1. Class Documentation¶
-
class
ZoomRatio
¶ Data class that represents zoom ratio as input_resolution/output_resolution.
Public Functions
-
ZoomRatio
()¶ Instantiate a zoom ratio 1:1.
-
~ZoomRatio
()¶
-
int
input_resolution
() const¶
-
int
output_resolution
() const¶
-
double
ratio
() const¶
-
bool
IsRealZoom
() const¶
Public Static Functions
-
static ZoomRatio
Create
(const std::string &ratio_string)¶ Create an instance from a formatted string (input_resolution:output_resolution)
- Return
- zoom ratio
- Parameters
ratio_string
: should be formatted as “input_resolution:output_resolution”
- Exceptions
sirius::Exception
: if string format or ratio is invalid
-
static ZoomRatio
Create
(int input_resolution, int output_resolution = 1)¶ Zoom ratio as input_resolution/output_resolution Reduce the ratio.
- Return
- zoom ratio
- Parameters
input_resolution
: numerator of the ratiooutput_resolution
: denominator of the ratio
- Exceptions
sirius::Exception
: if ratio is invalidstd::invalid_argument
: if conversion from string to int failed
-