private int getOriginalTargetSize( Resolution sourceResolution, Resolution targetResolution, int size, float factor) { final float resolutionScaleFactor = RefactorUtils.getScaleFactor(targetResolution, sourceResolution); final float sizeScaleFactor = factor / resolutionScaleFactor; return (int) (sizeScaleFactor * size); }
private float getRealScaleFactor(Resolution targetResolution) { final float resolutionScaleFactor = RefactorUtils.getScaleFactor(targetResolution, sourceResolution); final float sizeScaleFactor = (float) targetWidth / (float) originalImageWidth; return resolutionScaleFactor * sizeScaleFactor; }
@Override public int[] getScaledSize(Resolution resolution) { final float scaleFactor = RefactorUtils.getScaleFactor(resolution, sourceResolution); return new int[] {(int) (scaleFactor * targetWidth), (int) (scaleFactor * targetHeight)}; }