summaryrefslogtreecommitdiff
path: root/src/lib/image.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-25 22:17:23 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-25 22:17:23 +0100
commit1d68fe1e3ad1a9aa85fa7fc6071a0b8c64973953 (patch)
treecbad95204bf34c95ef2e6c6f5963eff00b81f140 /src/lib/image.cc
parente386b94425586760374d8e1cb16be99af09cf07f (diff)
Purge rint() and use llrint and friends.
Diffstat (limited to 'src/lib/image.cc')
-rw-r--r--src/lib/image.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc
index 0c7a0ef0d..fcdcca95a 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -76,8 +76,8 @@ Image::sample_size (int n) const
}
return dcp::Size (
- rint (ceil (static_cast<double>(size().width) / horizontal_factor)),
- rint (ceil (static_cast<double>(size().height) / line_factor (n)))
+ lrint (ceil (static_cast<double>(size().width) / horizontal_factor)),
+ lrint (ceil (static_cast<double>(size().height) / line_factor (n)))
);
}
@@ -166,7 +166,7 @@ Image::crop_scale_window (
round down so that we don't crop a subsampled pixel until
we've cropped all of its Y-channel pixels.
*/
- int const x = int (rint (bytes_per_pixel(c) * crop.left)) & ~ ((int) desc->log2_chroma_w);
+ int const x = lrintf (bytes_per_pixel(c) * crop.left) & ~ ((int) desc->log2_chroma_w);
scale_in_data[c] = data()[c] + x + stride()[c] * (crop.top / line_factor(c));
}
@@ -175,7 +175,7 @@ Image::crop_scale_window (
uint8_t* scale_out_data[out->planes()];
for (int c = 0; c < out->planes(); ++c) {
- scale_out_data[c] = out->data()[c] + int (rint (out->bytes_per_pixel(c) * corner.x)) + out->stride()[c] * corner.y;
+ scale_out_data[c] = out->data()[c] + lrintf (out->bytes_per_pixel(c) * corner.x) + out->stride()[c] * corner.y;
}
sws_scale (