- Classes
- Namespaces
- Interfaces
- Traits
- Index

PHP-FFMpeg API
Class

# FFMpeg\Coordinate\AspectRatio

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)`

#### Parameters

| $ratio |

###
at line 71
`public float getValue()`

Returns the value of the ratio.

#### Return Value

float |

###
at line 84
`public Integer calculateWidth(Integer $height, Integer $modulus = 1)`

Computes the best width for given height and modulus.

#### Parameters

Integer | $height |
Integer | $modulus |

#### Return Value

Integer |

###
at line 103
`public Integer calculateHeight(Integer $width, Integer $modulus = 1)`

Computes the best height for given width and modulus.

#### Parameters

Integer | $width |
Integer | $modulus |

#### Return Value

Integer |

###
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.

#### Parameters

Dimension | $dimension |
Boolean | $forceStandards | Whether to force or not standard ratios

#### Return Value

AspectRatio |

#### Exceptions

InvalidArgumentException |