ScalableSurface utility to validate and compute pixel-scale values.
| Modifier and Type | Field and Description |
|---|---|
| private static final float |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static float | Returns: the constrained pixel-scalepixel-scale to be constrained pixelScale, final float minimum pixel-scale minPixelScale, final float maximum pixel-scale maxPixelScale)Method constrains the given pixel-scale within ]0.. |
| public static float[] | Returns: the constrained result for chainingfloat[2] storage for result, maybe same as result, final float[] s for in-placefloat[2] pixelScale to be constrained pixelScale, final float[] float[2] minimum pixel-scale minPixelScale, final float[] float[2] maximum pixel-scale maxPixelScale)Method |
| private static boolean | |
| public static int | Returns: the integer rounded productthe int value a, final float the float scale factor pixelScale)Returns integer rounded product, i.e. |
| public static int[] | Returns: the result for chainingthe int[2] result, may be result, final int[] a for in-place operationthe int[2] values a, final float[] the float[2] scale factors pixelScale)Returns integer rounded product, i.e. |
| public static int | Returns: the integer rounded productthe int value a, final float the float scale factor pixelScale)Returns integer rounded product, i.e. |
| public static int[] | Returns: the result for chainingthe int[2] result, may be result, final int[] a for in-place operationthe int[2] values a, final float[] the float[2] scale factors pixelScale)Returns integer rounded product, i.e. |
| public static boolean | Returns: true if pixel-scale has changed, otherwise false.int[2] storage for result, maybe same as result, final float[] prePixelScale for in-placefloat[2] previous pixel-scale prePixelScale, final float[] float[2] requested pixel-scale, validated via reqPixelScale, final float[] validateReqPixelScale(float[], float[], String).float[2] minimum pixel-scale minPixelScale, final float[] float[2] maximum pixel-scale maxPixelScale, final String if set, dumps debug info on stderr using this prefix DEBUG_PREFIX)Method writes the given float[2] requested pixel-scale |
| EPSILON | back to summary |
|---|---|
| private static final float EPSILON | |
| SurfaceScaleUtils | back to summary |
|---|---|
| public SurfaceScaleUtils() | |
| clampPixelScale | back to summary |
|---|---|
| public static float clampPixelScale(final float pixelScale, final float minPixelScale, final float maxPixelScale) Method constrains the given pixel-scale within ]0..
Method returns
Method returns
Method returns
Otherwise method returns the given
~= denominates a delta ≤
| |
| clampPixelScale | back to summary |
|---|---|
| public static float[] clampPixelScale(final float[] result, final float[] pixelScale, final float[] minPixelScale, final float[] maxPixelScale) Method
| |
| isZero | back to summary |
|---|---|
| private static boolean isZero(final float a) | |
| scale | back to summary |
|---|---|
| public static int scale(final int a, final float pixelScale) Returns integer rounded product, i.e.
| |
| scale | back to summary |
|---|---|
| public static int[] scale(final int[] result, final int[] a, final float[] pixelScale) Returns integer rounded product, i.e.
| |
| scaleInv | back to summary |
|---|---|
| public static int scaleInv(final int a, final float pixelScale) Returns integer rounded product, i.e.
| |
| scaleInv | back to summary |
|---|---|
| public static int[] scaleInv(final int[] result, final int[] a, final float[] pixelScale) Returns integer rounded product, i.e.
| |
| setNewPixelScale | back to summary |
|---|---|
| public static boolean setNewPixelScale(final float[] result, final float[] prePixelScale, final float[] reqPixelScale, final float[] minPixelScale, final float[] maxPixelScale, final String DEBUG_PREFIX) Method writes the given float[2] requested pixel-scale
Method only differs from
| |