pad_bounds¶

pad_bounds(bounds, padding)[source]¶

Add padding to bounds.

Parameters:
  • bounds (tuple(int)) – Iterable of integer bounds. Must be even in length with the first half as starting values and the second half as end values, e.g. (start_x, start_y, stop_x, stop_y).

  • padding (int) – Padding to add to bounds.

Return type:

tuple[int, int, int, int]

Examples

>>> pad_bounds((0, 0, 0, 0), 1)
Returns:

Tuple of bounds with padding to the edges.

Return type:

tuple of int

Parameters: