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<'a>, VaError>
pub fn create_from<D: SurfaceMemoryDescriptor>( surface: &'a Surface<D>, format: VAImageFormat, coded_resolution: (u32, u32), visible_rect: (u32, u32), ) -> Result<Image<'a>, 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.