pierogis.ingredients.crop module

class pierogis.ingredients.crop.Crop(opacity: int = 100, mask: Optional[numpy.ndarray] = None, **kwargs)[source]

Bases: pierogis.ingredients.ingredient.Ingredient

crop starting from an origin and selecting an area both defined as a compass direction

X = 0
Y = 0
aspect: float
cook(pixels: numpy.ndarray) numpy.ndarray[source]

performs actions on a pixel array and returns a cooked array

height: int
origin: pierogis.ingredients.seasonings.cartography.Direction
prep(x: int = 0, y: int = 0, height: Optional[int] = None, width: Optional[int] = None, aspect: Optional[float] = None, origin: Union[str, pierogis.ingredients.seasonings.cartography.Direction] = Direction.SW, **kwargs) None[source]
Parameters
  • x – 0 = left

  • y – 0 = bottom

  • width – width in pixels

  • height – height in pixels

  • aspect – aspect ratio to fill missing height or width (width/height, 1 means square)

  • origin – location of origin for direction of crop select

width: int
x: int
y: int