diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-10-03 20:53:44 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-10-03 23:41:02 +0200 |
| commit | 70b72b53eab0f247eb4dc605a2d669d4adb4e469 (patch) | |
| tree | af117017f084fc2fedf0e2eaad667cda7d832b64 /src/lib/pixel_quanta.cc | |
| parent | c2a17a87868eba87072fc369102b2b3cd8905e5a (diff) | |
Differentiate requested and actual crop.
This is so we limit cropping to what is possible considering
chroma subsampling.
Diffstat (limited to 'src/lib/pixel_quanta.cc')
| -rw-r--r-- | src/lib/pixel_quanta.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/pixel_quanta.cc b/src/lib/pixel_quanta.cc index 12eea5031..09e684064 100644 --- a/src/lib/pixel_quanta.cc +++ b/src/lib/pixel_quanta.cc @@ -39,6 +39,20 @@ PixelQuanta::as_xml (xmlpp::Element* node) const } +int +PixelQuanta::round_x (int x_) const +{ + return x_ - (x_ % x); +} + + +int +PixelQuanta::round_y (int y_) const +{ + return y_ - (y_ % y); +} + + PixelQuanta max (PixelQuanta const& a, PixelQuanta const& b) { |
