Here you can find the source of computeSampleSizeLarger(float scale)
public static int computeSampleSizeLarger(float scale)
//package com.java2s; public class Main { public static int computeSampleSizeLarger(int w, int h, int minSideLength) { int initialSize = Math.max(w / minSideLength, h / minSideLength); if (initialSize <= 1) return 1; return initialSize <= 8 ? prevPowerOf2(initialSize) : initialSize / 8 * 8;//from w w w . jav a2s. c o m } public static int computeSampleSizeLarger(float scale) { int initialSize = (int) Math.floor(1f / scale); if (initialSize <= 1) return 1; return initialSize <= 8 ? prevPowerOf2(initialSize) : initialSize / 8 * 8; } private static int prevPowerOf2(int n) { if (n <= 0) throw new IllegalArgumentException(); return Integer.highestOneBit(n); } }