Common tools

The decorator module contains the cv_transformation decorator, used to transform an in-place open-cv2 array transformation.

pygamecv.common.cv_transformation(func: Callable[[ndarray], None])

Decorate a function to make it like a basic inplace surface transformation while it uses cv’s format.

pygamecv.common.make_surface_rgba(array: ndarray)

Returns a surface made from a [w, h, 4] numpy array with per-pixel alpha.