FileUtils.java 文件源码

java
阅读 55 收藏 0 点赞 0 评论 0

项目:letv 作者:
private static int computeInitialSampleSize(Options options, int minSideLength, int maxNumOfPixels) {
    double w = (double) options.outWidth;
    double h = (double) options.outHeight;
    int lowerBound = maxNumOfPixels == -1 ? 1 : (int) Math.ceil(Math.sqrt((w * h) / ((double) maxNumOfPixels)));
    int upperBound = minSideLength == -1 ? 128 : (int) Math.min(Math.floor(w / ((double) minSideLength)), Math.floor(h / ((double) minSideLength)));
    if (upperBound < lowerBound) {
        return lowerBound;
    }
    if (maxNumOfPixels == -1 && minSideLength == -1) {
        return 1;
    }
    if (minSideLength != -1) {
        return upperBound;
    }
    return lowerBound;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号