- Classes
- Namespaces
- Interfaces
- Index

Imagine API
Interface

# Imagine\Image\BoxInterface

interface BoxInterface

Interface for a box

## Methods

integer | getHeight() Gets current image height |
integer | getWidth() Gets current image width |
BoxInterface | scale(float $ratio) Creates new BoxInterface instance with ratios applied to both sides |
BoxInterface | increase(integer $size) Creates new BoxInterface, adding given size to both sides |
Boolean | contains(BoxInterface $box, PointInterface $start = null) Checks whether current box can fit given box at a given start position, start position defaults to top left corner xy(0,0) |
integer | square() Gets current box square, useful for getting total number of pixels in a given box |
string | __toString() Returns a string representation of the current box |
BoxInterface | widen(integer $width) Resizes box to given width, constraining proportions and returns the new box |
BoxInterface | heighten(integer $height) Resizes box to given height, constraining proportions and returns the new box |

## Details

###
at line 26
`public integer getHeight()`

Gets current image height

#### Return Value

integer |

###
at line 33
`public integer getWidth()`

Gets current image width

#### Return Value

integer |

###
at line 42
`public BoxInterface scale(float $ratio)`

Creates new BoxInterface instance with ratios applied to both sides

#### Parameters

float | $ratio |

#### Return Value

BoxInterface |

###
at line 51
`public BoxInterface increase(integer $size)`

Creates new BoxInterface, adding given size to both sides

#### Parameters

integer | $size |

#### Return Value

BoxInterface |

###
at line 62
`public Boolean contains(BoxInterface $box, PointInterface $start = null)`

Checks whether current box can fit given box at a given start position, start position defaults to top left corner xy(0,0)

#### Parameters

BoxInterface | $box |
PointInterface | $start |

#### Return Value

Boolean |

###
at line 70
`public integer square()`

Gets current box square, useful for getting total number of pixels in a given box

#### Return Value

integer |

###
at line 77
`public string __toString()`

Returns a string representation of the current box

#### Return Value

string |

###
at line 86
`public BoxInterface widen(integer $width)`

Resizes box to given width, constraining proportions and returns the new box

#### Parameters

integer | $width |

#### Return Value

BoxInterface |

###
at line 95
`public BoxInterface heighten(integer $height)`

Resizes box to given height, constraining proportions and returns the new box

#### Parameters

integer | $height |

#### Return Value

BoxInterface |