93 return (_resolution <= 0);
101 return qFuzzyIsNull(_resolution);
116 operator QString()
const {
117 return QString(
"%1dpi").arg(
get(
dpi));
128 return _resolution == other._resolution;
187 return res1._resolution > res2._resolution ? res1 : res2;
The length stores a length and converts between units.
qreal get(unit u) const
Returns length in given unit.
The resolution class stores a resolution and converts between units.
bool isValid() const
Check if resolution is valid.
length operator/(qreal numerator, const resolution denominator)
Divide a scalar ("number of dots") by a resolution to obtain a length.
resolution(qreal l, unit u)
Constructs resolution of given value and unit.
unit
List of supported units.
@ dpcm
Pixel per Centimeter.
@ dpm
Pixel per Millimeter.
bool operator==(const resolution other) const
Check for equality.
bool isNonPositive() const
Check if resolution is zero or less.
static const int maxResDPI
Maximal resolution handled by scantools.
resolution operator/(qreal numerator, const length denominator)
Divide a scalar by a length to obtain a resolution.
qreal get(unit u) const
Get numerical value for resolution.
void set(qreal l, unit u)
Sets resolution in given unit.
bool isZero() const
Fuzzy check if resolution is zero.
resolution()
Constructs a zero resolution.
friend resolution qMax(const resolution res1, const resolution res2)
Find the maximum of two resolutions.
static const int minResDPI
Minimal resolution handled by scantools.