edifice.extra.numpy_image.NumpyImage#

class edifice.extra.numpy_image.NumpyImage(src, aspect_ratio_mode=None, **kwargs)[source]#

Bases: QtWidgetElement

Render a numpy array as an image.

Parameters:
  • src (NumpyArray[uint8]) –

    A NumpyArray wrapping a numpy.ndarray of uint8.

    Allowed shapes:

    • (height, width)

    • (height, width, 1)

    • (height, width, 3)

    • (height, width, 4)

  • aspect_ratio_mode (Optional[AspectRatioMode]) –

    The aspect ratio mode of the image.

    • None for a fixed image which doesn’t scale.

    • An AspectRatioMode to specify how the image should scale.

Methods

__init__(src[, aspect_ratio_mode])

register_ref(reference)

Registers provided Reference to this Element.

set_key(key)

Set the key of an Element.

Attributes

children

The children of this Element.

props

The props of this Element.

underlying

The underlying QWidget, which may not exist if this Element has not rendered.