pierogis.ingredients.rotate module

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

Bases: pierogis.ingredients.ingredient.Ingredient

rotate a pixel array

FILTERS = {'bicubic': 3, 'bilinear': 2, 'box': 4, 'default': 0, 'hamming': 5, 'lanczos': 1, 'nearest': 0}
cook(pixels: numpy.ndarray)[source]

rotate the pixels according to angle

prep(clockwise: bool = True, turns: int = 1, angle: int = 90, resample: Union[int, str] = 0, **kwargs)[source]

provide a given number of turns in a specified direction

Parameters
  • clockwise – if True, top left pixel becomes top right

  • turns – number of “angle” degree turns to make

  • angle – distance to turn

  • resample – resample filter to use

classmethod unrotate(rotate: pierogis.ingredients.rotate.Rotate)[source]

return a Rotate that will reverse the given Rotate

Parameters

rotate – the rotate to reverse