public class ImageExtensionFactors
extends java.lang.Object
upFactor
and downFactor
define extensions relative to image height, e.g.
when upFactor
is 0.5, upper image boundary will be extended for half of image's full
height.Constructor and Description |
---|
ImageExtensionFactors(float upFactor,
float downFactor,
float leftFactor,
float rightFactor)
Constructor which accepts image extension factors which must be in range [0.0f, 1.0f].
|
Modifier and Type | Method and Description |
---|---|
static ImageExtensionFactors |
createFromArray(float[] factors)
Creates factors object from float array.
|
float |
getDownFactor()
Returns currently used image extension factor relative to full image height in DOWN direction.
|
float |
getLeftFactor()
Returns currently used image extension factor relative to full image width in LEFT direction.
|
float |
getRightFactor()
Returns currently used image extension factor relative to full image width in RIGHT direction.
|
float |
getUpFactor()
Returns currently used image extension factor relative to full image height in UP direction.
|
float[] |
serializeToArray()
Serializes factors to array, factors are placed in resulting array in the following order
[upFactor, rightFactor, downFactor, leftFactor].
|
public ImageExtensionFactors(float upFactor, float downFactor, float leftFactor, float rightFactor)
upFactor
- image extension factor relative to full image height in UP directiondownFactor
- image extension factor relative to full image height in DOWN directionleftFactor
- image extension factor relative to full image width in LEFT directionrightFactor
- image extension factor relative to full image width in RIGHT directionpublic float getUpFactor()
public float getDownFactor()
public float getRightFactor()
public float getLeftFactor()
@NonNull public float[] serializeToArray()
@NonNull public static final ImageExtensionFactors createFromArray(@NonNull float[] factors)
factors
- factors array, expected order of factors is:
[upFactor, rightFactor, downFactor, leftFactor].
Factors must be in range [0.0, 1.0].