
Public Member Functions | |
| np.ndarray | to_numpy_array (self, bool copy=True) |
| Returns the image data as a NumPy array. | |
| memoryview | to_memoryview (self) |
| Return a zero-copy memoryview of the image data. | |
| PixelFormat | pixel_format (self) |
| Returns the pixel format of the image. | |
| Size | size (self) |
| Returns the image dimensions as a Size object. | |
| int | width (self) |
| Returns the width of the image in pixels. | |
| int | height (self) |
| Returns the height of the image in pixels. | |
| Metadata | metadata (self) |
| Returns the metadata object which can be used to retrieve or set metadata belonging to the image. | |
Interface for viewing image pixel data from arbitrary sources, for example a camera buffer.
| int height | ( | self | ) |
Returns the height of the image in pixels.
| Metadata metadata | ( | self | ) |
Returns the metadata object which can be used to retrieve or set metadata belonging to the image.
| PixelFormat pixel_format | ( | self | ) |
Returns the pixel format of the image.
| Size size | ( | self | ) |
Returns the image dimensions as a Size object.
| memoryview to_memoryview | ( | self | ) |
Return a zero-copy memoryview of the image data.
The returned memoryview provides direct access to the underlying image data without copying data. Modifying the memoryview will modify the image data itself. Ensure that the image view and its underlying buffer remain valid before accessing or using the memoryview.
| np.ndarray to_numpy_array | ( | self, | |
| bool | copy = True ) |
Returns the image data as a NumPy array.
By default, the data is copied. Setting copy=False makes the array share memory with the internal buffer, so any changes to the array will be reflected in the image data.
The dimensionality of the returned NumPy array varies according to the pixel format:
| copy | Whether to copy the data. Default is True. |
| int width | ( | self | ) |
Returns the width of the image in pixels.