# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/12_image.ipynb.

# %% auto 0
__all__ = ['BoundingBox']

# %% ../../nbs/12_image.ipynb 2
from dataclasses import dataclass

# %% ../../nbs/12_image.ipynb 4
@dataclass(frozen=True)
class BoundingBox:
    """
    Bounding box representation with:
        - (x1, y1) been the top-left corner
        - (x2, y2) been the bottom-right corner
    """
    x1: int
    y1: int
    x2: int
    y2: int

    def area(self) -> int:
        width = self.x2 - self.x1
        height = self.y2 - self.y1
        return width * height
