3.3.2.31. Class ZoomRatio

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()
ZoomRatio(const ZoomRatio&)
ZoomRatio(ZoomRatio&&)
ZoomRatio &operator=(const ZoomRatio&)
ZoomRatio &operator=(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

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 ratio
  • output_resolution: denominator of the ratio
Exceptions
  • sirius::Exception: if ratio is invalid
  • std::invalid_argument: if conversion from string to int failed