程序包 dev.utils.common
类 ScaleUtils
java.lang.Object
dev.utils.common.ScaleUtils
detail: 计算比例工具类
- 作者:
- Ttt
-
嵌套类概要
嵌套类 -
字段概要
字段 -
方法概要
修饰符和类型方法说明static double[]calcHeightToScale(double height, double widthScale, double heightScale) 以高度为基准, 转换对应比例的宽度static float[]calcHeightToScaleF(double height, double widthScale, double heightScale) 以高度为基准, 转换对应比例的宽度static int[]calcHeightToScaleI(double height, double widthScale, double heightScale) 以高度为基准, 转换对应比例的宽度static long[]calcHeightToScaleL(double height, double widthScale, double heightScale) 以高度为基准, 转换对应比例的宽度static doublecalcScale(double dividend, double divisor) 计算比例 ( 商 )static double[]calcScaleToHeight(double targetHeight, double currentWidth, double currentHeight) 计算缩放比例 ( 根据高度比例转换宽度 )static float[]calcScaleToHeightF(double targetHeight, double currentWidth, double currentHeight) 计算缩放比例 ( 根据高度比例转换宽度 )static int[]calcScaleToHeightI(double targetHeight, double currentWidth, double currentHeight) 计算缩放比例 ( 根据高度比例转换宽度 )static long[]calcScaleToHeightL(double targetHeight, double currentWidth, double currentHeight) 计算缩放比例 ( 根据高度比例转换宽度 )static doublecalcScaleToMath(double value1, double value2) 计算比例 ( 被除数 ( 最大值 ) / 除数 ( 最小值 ) )static double[]calcScaleToWidth(double targetWidth, double currentWidth, double currentHeight) 计算缩放比例 ( 根据宽度比例转换高度 )static float[]calcScaleToWidthF(double targetWidth, double currentWidth, double currentHeight) 计算缩放比例 ( 根据宽度比例转换高度 )static int[]calcScaleToWidthI(double targetWidth, double currentWidth, double currentHeight) 计算缩放比例 ( 根据宽度比例转换高度 )static long[]calcScaleToWidthL(double targetWidth, double currentWidth, double currentHeight) 计算缩放比例 ( 根据宽度比例转换高度 )static double[]calcWidthHeightToScale(double width, double height, double widthScale, double heightScale) 通过宽度、高度根据对应的比例, 转换成对应的比例宽度高度 ( 智能转换 )static float[]calcWidthHeightToScaleF(double width, double height, double widthScale, double heightScale) 通过宽度、高度根据对应的比例, 转换成对应的比例宽度高度 ( 智能转换 )static int[]calcWidthHeightToScaleI(double width, double height, double widthScale, double heightScale) 通过宽度、高度根据对应的比例, 转换成对应的比例宽度高度 ( 智能转换 )static long[]calcWidthHeightToScaleL(double width, double height, double widthScale, double heightScale) 通过宽度、高度根据对应的比例, 转换成对应的比例宽度高度 ( 智能转换 )static double[]calcWidthToScale(double width, double widthScale, double heightScale) 以宽度为基准, 转换对应比例的高度static float[]calcWidthToScaleF(double width, double widthScale, double heightScale) 以宽度为基准, 转换对应比例的高度static int[]calcWidthToScaleI(double width, double widthScale, double heightScale) 以宽度为基准, 转换对应比例的高度static long[]calcWidthToScaleL(double width, double widthScale, double heightScale) 以宽度为基准, 转换对应比例的高度static ScaleUtils.XYcalcXY(int x, int y) 计算 XY 比static ScaleUtils.XYcalcXY(List<ScaleUtils.XY> xyLists, int x, int y) 计算 XY 比
-
字段详细资料
-
XY_LIST
-
-
方法详细资料
-
calcScale
public static double calcScale(double dividend, double divisor) 计算比例 ( 商 )- 参数:
dividend- 被除数divisor- 除数- 返回:
- 商
-
calcScaleToMath
public static double calcScaleToMath(double value1, double value2) 计算比例 ( 被除数 ( 最大值 ) / 除数 ( 最小值 ) )- 参数:
value1- 第一个值value2- 第二个值- 返回:
- 被除数 ( 最大值 ) / 除数 ( 最小值 ) = 商
-
calcScaleToWidth
public static double[] calcScaleToWidth(double targetWidth, double currentWidth, double currentHeight) 计算缩放比例 ( 根据宽度比例转换高度 )- 参数:
targetWidth- 需要的最终宽度currentWidth- 当前宽度currentHeight- 当前高度- 返回:
- double[] { 宽度, 高度 }
-
calcScaleToHeight
public static double[] calcScaleToHeight(double targetHeight, double currentWidth, double currentHeight) 计算缩放比例 ( 根据高度比例转换宽度 )- 参数:
targetHeight- 需要的最终高度currentWidth- 当前宽度currentHeight- 当前高度- 返回:
- double[] { 宽度, 高度 }
-
calcWidthHeightToScale
public static double[] calcWidthHeightToScale(double width, double height, double widthScale, double heightScale) 通过宽度、高度根据对应的比例, 转换成对应的比例宽度高度 ( 智能转换 )- 参数:
width- 宽度height- 高度widthScale- 宽度比例heightScale- 高度比例- 返回:
- double[] { 宽度, 高度 }
-
calcWidthToScale
public static double[] calcWidthToScale(double width, double widthScale, double heightScale) 以宽度为基准, 转换对应比例的高度- 参数:
width- 宽度widthScale- 宽度比例heightScale- 高度比例- 返回:
- double[] { 宽度, 高度 }
-
calcHeightToScale
public static double[] calcHeightToScale(double height, double widthScale, double heightScale) 以高度为基准, 转换对应比例的宽度- 参数:
height- 高度widthScale- 宽度比例heightScale- 高度比例- 返回:
- double[] { 宽度, 高度 }
-
calcScaleToWidthI
public static int[] calcScaleToWidthI(double targetWidth, double currentWidth, double currentHeight) 计算缩放比例 ( 根据宽度比例转换高度 )- 参数:
targetWidth- 需要的最终宽度currentWidth- 当前宽度currentHeight- 当前高度- 返回:
- int[] { 宽度, 高度 }
-
calcScaleToHeightI
public static int[] calcScaleToHeightI(double targetHeight, double currentWidth, double currentHeight) 计算缩放比例 ( 根据高度比例转换宽度 )- 参数:
targetHeight- 需要的最终高度currentWidth- 当前宽度currentHeight- 当前高度- 返回:
- int[] { 宽度, 高度 }
-
calcWidthHeightToScaleI
public static int[] calcWidthHeightToScaleI(double width, double height, double widthScale, double heightScale) 通过宽度、高度根据对应的比例, 转换成对应的比例宽度高度 ( 智能转换 )- 参数:
width- 宽度height- 高度widthScale- 宽度比例heightScale- 高度比例- 返回:
- int[] { 宽度, 高度 }
-
calcWidthToScaleI
public static int[] calcWidthToScaleI(double width, double widthScale, double heightScale) 以宽度为基准, 转换对应比例的高度- 参数:
width- 宽度widthScale- 宽度比例heightScale- 高度比例- 返回:
- int[] { 宽度, 高度 }
-
calcHeightToScaleI
public static int[] calcHeightToScaleI(double height, double widthScale, double heightScale) 以高度为基准, 转换对应比例的宽度- 参数:
height- 高度widthScale- 宽度比例heightScale- 高度比例- 返回:
- int[] { 宽度, 高度 }
-
calcScaleToWidthL
public static long[] calcScaleToWidthL(double targetWidth, double currentWidth, double currentHeight) 计算缩放比例 ( 根据宽度比例转换高度 )- 参数:
targetWidth- 需要的最终宽度currentWidth- 当前宽度currentHeight- 当前高度- 返回:
- long[] { 宽度, 高度 }
-
calcScaleToHeightL
public static long[] calcScaleToHeightL(double targetHeight, double currentWidth, double currentHeight) 计算缩放比例 ( 根据高度比例转换宽度 )- 参数:
targetHeight- 需要的最终高度currentWidth- 当前宽度currentHeight- 当前高度- 返回:
- long[] { 宽度, 高度 }
-
calcWidthHeightToScaleL
public static long[] calcWidthHeightToScaleL(double width, double height, double widthScale, double heightScale) 通过宽度、高度根据对应的比例, 转换成对应的比例宽度高度 ( 智能转换 )- 参数:
width- 宽度height- 高度widthScale- 宽度比例heightScale- 高度比例- 返回:
- long[] { 宽度, 高度 }
-
calcWidthToScaleL
public static long[] calcWidthToScaleL(double width, double widthScale, double heightScale) 以宽度为基准, 转换对应比例的高度- 参数:
width- 宽度widthScale- 宽度比例heightScale- 高度比例- 返回:
- long[] { 宽度, 高度 }
-
calcHeightToScaleL
public static long[] calcHeightToScaleL(double height, double widthScale, double heightScale) 以高度为基准, 转换对应比例的宽度- 参数:
height- 高度widthScale- 宽度比例heightScale- 高度比例- 返回:
- long[] { 宽度, 高度 }
-
calcScaleToWidthF
public static float[] calcScaleToWidthF(double targetWidth, double currentWidth, double currentHeight) 计算缩放比例 ( 根据宽度比例转换高度 )- 参数:
targetWidth- 需要的最终宽度currentWidth- 当前宽度currentHeight- 当前高度- 返回:
- float[] { 宽度, 高度 }
-
calcScaleToHeightF
public static float[] calcScaleToHeightF(double targetHeight, double currentWidth, double currentHeight) 计算缩放比例 ( 根据高度比例转换宽度 )- 参数:
targetHeight- 需要的最终高度currentWidth- 当前宽度currentHeight- 当前高度- 返回:
- float[] { 宽度, 高度 }
-
calcWidthHeightToScaleF
public static float[] calcWidthHeightToScaleF(double width, double height, double widthScale, double heightScale) 通过宽度、高度根据对应的比例, 转换成对应的比例宽度高度 ( 智能转换 )- 参数:
width- 宽度height- 高度widthScale- 宽度比例heightScale- 高度比例- 返回:
- float[] { 宽度, 高度 }
-
calcWidthToScaleF
public static float[] calcWidthToScaleF(double width, double widthScale, double heightScale) 以宽度为基准, 转换对应比例的高度- 参数:
width- 宽度widthScale- 宽度比例heightScale- 高度比例- 返回:
- float[] { 宽度, 高度 }
-
calcHeightToScaleF
public static float[] calcHeightToScaleF(double height, double widthScale, double heightScale) 以高度为基准, 转换对应比例的宽度- 参数:
height- 高度widthScale- 宽度比例heightScale- 高度比例- 返回:
- float[] { 宽度, 高度 }
-
calcXY
计算 XY 比- 参数:
x- X 值y- Y 值- 返回:
- XY 比实体类
-
calcXY
计算 XY 比- 参数:
xyLists- XY 比集合x- X 值y- Y 值- 返回:
- XY 比实体类
-