CVBpy 14.1
WrappedImage Class Reference

A wrapped image wraps another pixel buffer without owning it. More...

Inherits Image.

Public Member Functions

cvb.WrappedImage from_buffer (Any buffer, int layout=cvb.BufferLayout.HeightWidthPlane)
 Wraps, without copying, the given python buffer in an image. More...
 
- Public Member Functions inherited from Image
cvb.Image clone (self)
 Creates a new image object, that is a copy of the current instance. More...
 
None copy (self, cvb.Image target_image, Optional[cvb.Rect] source_rect, Optional[cvb.Point2D] target_position)
 Copies the image data from the source rectangle of this image to the target position inside the target image. More...
 
cvb.Image create (int width, int height, Optional[int] num_planes, Optional[cvb.DataType] data_type)
 Creates an uninitialized image with the given parameters. More...
 
cvb.Image create (cvb.Size2D size, Optional[int] num_planes, Optional[cvb.DataType] data_type)
 Creates an uninitialized image with the given parameters. More...
 
cvb.Image from_images (int mapping, List[cvb.Image] images)
 Create an image that is the result of concatenating a series of input images. More...
 
cvb.Image from_pixel_format (cvb.Size2D size, int format)
 Creates an uninitialized image with the given parameters. More...
 
cvb.Image from_pixel_format (int width, int height, int format)
 Creates an uninitialized image with the given parameters. More...
 
cvb.Image from_planes (int mapping, List[cvb.ImagePlane] planes)
 Create an image that is the result of concatenating a series of input planes. More...
 
List[float] get_pixel (self, cvb.Point2D position)
 Gets the pixel values for all planes at a give position (as float list). More...
 
cvb.Point2D image_to_pixel_coordinates (self, cvb.Point2D point)
 Convert a point from image to pixel coordinates. More...
 
cvb.Area2D image_to_pixel_coordinates (self, cvb.Area2D area)
 Convert an area from image to pixel coordinates. More...
 
cvb.Image load (str file_name)
 Loads an image with the given file name. More...
 
cvb.Image map (self, cvb.Rect source_rect, Optional[cvb.Size2D] target_size)
 Creates a mapped image of the region of that image scaled to the size. More...
 
cvb.Image map_rotated (self, int rotation)
 Creates a mapped image of this whole image rotated by the given rotation. More...
 
cvb.Point2D pixel_to_image_coordinates (self, cvb.Point2D point)
 Convert a point from pixel to image coordinates. More...
 
cvb.Point2D pixel_to_image_coordinates (self, cvb.Point2D area)
 Convert an area from pixel to image coordinates. More...
 
None raise_pixel_content_changed (self, cvb.Rect rect)
 Inform clients listening to the pixel content changed event, that the image data has been updated in the given rectangle. More...
 
cvb.EventCookie register_event_pixel_content_changed (self, Callable[[cvb.Image, cvb.Rect], None] handler)
 Register a listener to the pixel content changed event. More...
 
None save (self)
 Write the current content of the image into a file. More...
 
None save (self, str file_name, float quality)
 Write the current content of the image into a file with the given quality. More...
 
None unregister_event_pixel_content_changed (self, cvb.EventCookie event_cookie)
 Manually unregister a listener from the pixel content changed event. More...
 

Additional Inherited Members

- Properties inherited from Image
 bounds = property
 cvb.Rect: Bounding rectangle of the image in pixels.
 
 color_model = property
 int: Color model realized by this image (see cvb.ColorModel).
 
 coordinate_system = property
 cvb.AffineMatrix2D: Gets or sets the coordinate system of the image.
 
 height = property
 int: Height of the image in pixels.
 
 plane_data_types_identical = property
 bool: Check if all planes have the same data type.
 
 planes = property
 List[cvb.ImagePlane]: Access all planes for this image.
 
 size = property
 cvb.Size2D: Size of the image in pixels.
 
 width = property
 int: Width of the image in pixels.
 

Detailed Description

A wrapped image wraps another pixel buffer without owning it.

This class is not intended for general use. Providing invalid values or not ensuring the validity of the associated buffer at all times will most likely lead to severe problems in your application.

Member Function Documentation

◆ from_buffer()

cvb.WrappedImage from_buffer ( Any  buffer,
int   layout = cvb.BufferLayout.HeightWidthPlane 
)

Wraps, without copying, the given python buffer in an image.

You need to take care of the buffers lifetime!

Parameters

buffer : Any Python buffer that supports the buffer protocol.

layout : int The buffer layout (see cvb.BufferLayout).

Returns

cvb.WrappedImage The created image.