class AspectRatio
Constants
AR_4_3 |
|
AR_16_9 |
|
AR_3_2 |
|
AR_5_3 |
|
AR_5_4 |
|
AR_1_1 |
|
AR_1_DOT_85_1 |
|
AR_2_DOT_39_1 |
|
AR_ROTATED_3_4 |
|
AR_ROTATED_9_16 |
|
AR_ROTATED_2_3 |
|
AR_ROTATED_3_5 |
|
AR_ROTATED_4_5 |
|
AR_ROTATED_1_DOT_85 |
|
AR_ROTATED_2_DOT_39 |
|
Methods
__construct($ratio)
|
||
float |
getValue()
Returns the value of the ratio. |
|
Integer |
calculateWidth(Integer $height, Integer $modulus = 1)
Computes the best width for given height and modulus. |
|
Integer |
calculateHeight(Integer $width, Integer $modulus = 1)
Computes the best height for given width and modulus. |
|
static AspectRatio |
create(Dimension $dimension, Boolean $forceStandards = true)
Creates a ratio based on Dimension. |
Details
at line 61
public
__construct($ratio)
at line 71
public float
getValue()
Returns the value of the ratio.
at line 84
public Integer
calculateWidth(Integer $height, Integer $modulus = 1)
Computes the best width for given height and modulus.
at line 103
public Integer
calculateHeight(Integer $width, Integer $modulus = 1)
Computes the best height for given width and modulus.
at line 145
static public AspectRatio
create(Dimension $dimension, Boolean $forceStandards = true)
Creates a ratio based on Dimension.
The strategy parameter forces by default to use standardized ratios. If custom ratio need to be used, disable it.