Home | History | Annotate | Download | only in data

Lines Matching refs:original

130     public final DrawableRequestBuilder<Uri> loadFull(Uri uri, Key key, Size original) {
131 Size size = clampSize(original, MAXIMUM_FULL_RES_PIXELS, getMaxImageDisplaySize());
145 public DrawableRequestBuilder<Uri> loadScreen(Uri uri, Key key, Size original) {
146 Size size = clampSize(original, MAXIMUM_SMOOTH_PIXELS, getMaxImageDisplaySize());
186 * Given a size, compute a value such that it will downscale the original size
191 private static Size clampSize(Size original, double maxArea, Size maxSize) {
192 if (original.getWidth() * original.getHeight() < maxArea &&
193 original.getWidth() < maxSize.getWidth() &&
194 original.getHeight() < maxSize.getHeight()) {
197 return original;
202 double ratio = Math.min(Math.sqrt(maxArea / original.area()), 1.0f);
203 int width = (int) Math.round(original.width() * ratio);
204 int height = (int) Math.round(original.height() * ratio);
209 return computeFitWithinSize(original, maxSize);
215 private static Size computeFitWithinSize(Size original, Size maxSize) {
216 double widthRatio = (double) maxSize.width() / original.width();
217 double heightRatio = (double) maxSize.height() / original.height();
224 Math.min((int) Math.round(original.width() * ratio), maxSize.width()),
225 Math.min((int) Math.round(original.height() * ratio), maxSize.height()));