X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fpixel_quanta.cc;h=7c1d285cffd3d0c1b55b0384f73cc582b10cd135;hb=969906f2dd6c5c144781861f53e2a0f6baefb9a3;hp=12eea5031a606a88427233b631f30822dde4cba2;hpb=c2a17a87868eba87072fc369102b2b3cd8905e5a;p=dcpomatic.git diff --git a/src/lib/pixel_quanta.cc b/src/lib/pixel_quanta.cc index 12eea5031..7c1d285cf 100644 --- a/src/lib/pixel_quanta.cc +++ b/src/lib/pixel_quanta.cc @@ -39,6 +39,27 @@ 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); +} + + +dcp::Size +PixelQuanta::round (dcp::Size size) const +{ + return dcp::Size (round_x(size.width), round_y(size.height)); +} + + PixelQuanta max (PixelQuanta const& a, PixelQuanta const& b) {