Struct cros_libva::Image
source · pub struct Image<'a> { /* private fields */ }Expand description
Wrapper around VAImage that is tied to the lifetime of a given Picture.
An image is used to either get the surface data to client memory, or to copy image data in client memory to a surface.
Implementations§
source§impl<'a> Image<'a>
impl<'a> Image<'a>
sourcepub fn derive_from<D: SurfaceMemoryDescriptor>(
surface: &'a Surface<D>,
visible_rect: (u32, u32),
) -> Result<Self, VaError>
pub fn derive_from<D: SurfaceMemoryDescriptor>( surface: &'a Surface<D>, visible_rect: (u32, u32), ) -> Result<Self, VaError>
Create a new derived image from this surface using vaDeriveImage.
Derived images are a direct view (i.e. without any copy) on the buffer content of
surface. On the other hand, not all Surfaces can be derived.
visible_rect is the visible rectangle inside surface that we want to access.
sourcepub fn create_from<D: SurfaceMemoryDescriptor>(
surface: &'a Surface<D>,
format: VAImageFormat,
coded_resolution: (u32, u32),
visible_rect: (u32, u32),
) -> Result<Image<'_>, VaError>
pub fn create_from<D: SurfaceMemoryDescriptor>( surface: &'a Surface<D>, format: VAImageFormat, coded_resolution: (u32, u32), visible_rect: (u32, u32), ) -> Result<Image<'_>, VaError>
Create new image from surface using vaCreateImage and vaGetImage.
visible_rect is the visible rectangle inside surface that we want to access.
The image will contain a copy of surface‘s data’ in the desired format and
coded_resolution, meaning the data can be scaled if coded_resolution and visible_rect
differ.
sourcepub fn image(&self) -> &_VAImage
pub fn image(&self) -> &_VAImage
Get a reference to the underlying VAImage that describes this image.
sourcepub fn is_derived(&self) -> bool
pub fn is_derived(&self) -> bool
Returns whether this image is directly derived from its underlying Picture, as opposed to
being a view/copy of said Picture in a guaranteed pixel format.
sourcepub fn display_resolution(&self) -> (u32, u32)
pub fn display_resolution(&self) -> (u32, u32)
Returns the display resolution as passed in by the client. This is a value that is less than or equal to the coded resolution.
sourcepub fn coded_resolution(&self) -> (u32, u32)
pub fn coded_resolution(&self) -> (u32, u32)
Returns the coded resolution. This value can be larger than the value passed in when the image was created if the driver needs to.