IDS peak ICV v1.6.0
Loading...
Searching...
No Matches
IImageView Class Reference
Inheritance diagram for IImageView:

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.
 

Detailed Description

Interface for viewing image pixel data from arbitrary sources, for example a camera buffer.

Member Function Documentation

◆ height()

int height ( self)

Returns the height of the image in pixels.

◆ metadata()

Metadata metadata ( self)

Returns the metadata object which can be used to retrieve or set metadata belonging to the image.

◆ pixel_format()

PixelFormat pixel_format ( self)

Returns the pixel format of the image.

◆ size()

Size size ( self)

Returns the image dimensions as a Size object.

◆ to_memoryview()

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.

◆ to_numpy_array()

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:

  • Packed formats produce a 1-dimensional array.
  • Single-channel formats (for example, Mono8) produce a 2-dimensional array with shape (height, width).
  • Multi-channel formats (for example, RGB8) produce a 3-dimensional array with shape (height, width, num_channels).
Parameters
copyWhether to copy the data. Default is True.
Returns
The image data as a NumPy array.

◆ width()

int width ( self)

Returns the width of the image in pixels.