add_image_yuv#
- Subplot.add_image_yuv(data, vmin=0, vmax=255, gamma=1.0, interpolation='nearest', colorspace='yuv420p', colorrange='limited', **kwargs)#
Create an ImageYUVGraphic. Similar to ImageGraphic but handles data that is in yuv42p or yuv444p colorspace.
Note that the buffers for YUV Images only exist on the GPU. When setting the image data, the new values are directly sent to the GPU.
reset_vmin_vmax()just sets (vmin, vmax) to (0, 255)- Parameters:
data (TupleYUV) – tuple of arrays that represent YUV channels. If the colorspace is yuv420p, the U and V array dims must be 4 times smaller than the Y array dims.
vmin (float, optional, default 0) – minimum value for color scaling
vmax (float, optional, default 255) – maximum value for color scaling
gamma (float, default 1.0) – gamma correction, the value scaled by
vminandvmaxis raised to the power ofgammainterpolation (str, optional, default "nearest") – interpolation filter, one of “nearest” or “linear”
colorspace ("yuv42p" | "yuv444p") –
colorspace in which to interpret the provided data.
”yuv420p”: A common video format. The data is represented as 3 planes (y, u, and v). The y represents intensity, and is at full resolution. The u and v planes are a quarter of the size.
”yuv444p”: A lesser common video format. The data is represented as 3 planes (y, u, and v) similar to yuv420p however the u and v planes are stored at full resolution.
colorrange (Literal["full", "limited"] = "limited",) –
Relevant for yuv colorspaces. Most videos use “limited”.
”limited”: The luma plane (Y) is limited to the range of 16-235 for 8 bits. The chroma planes (U and V) are limited to the range of 16-240 for 8 bits
”full”: The luma plane and chroma plane use the full range of the storage format.
See the following links from the FFMPEG documentation for more details: https://trac.ffmpeg.org/wiki/colorspace https://ffmpeg.org/doxygen/7.0/pixfmt_8h_source.html#l00609
cpu_buffer (bool, default True) –
If
True, maintains a buffer of system RAM that is sychronized with a corresponding storage buffer on the GPU. IfFalse, setting the graphic data will send the new data directly to the GPU, we also call this “bufferless”. This is much faster but lacks the following features:- you must update the entire data array, i.e. you can perform
image.data = new_data, and you cannot perform partial updates such as
image.data[indices] = <new_data_at_indices>.
- you must update the entire data array, i.e. you can perform
- RGB arrays of shape [rows, cols, 3] are not supported since wgpu does not have RGB textures,
use RGBA or use cpu_buffer=True if you really need RGB instead of RGBA.
- tooltip values for grayscale data are estimated using an inverse transforms on the colormap LUT.
The tooltip values may or may not be accurate for a given colormap and vmin, vmax. If you require precise and reliable tooltip values for grayscale data use cpu_buffer=True.
kwargs – additional keyword arguments passed to
Graphic
- Return type: