CUDA_NVSurfaceToColorConverterTrait

Trait CUDA_NVSurfaceToColorConverterTrait 

Source
pub trait CUDA_NVSurfaceToColorConverterTrait: CUDA_NVSurfaceToColorConverterTraitConst {
    // Required method
    fn as_raw_mut_CUDA_NVSurfaceToColorConverter(&mut self) -> *mut c_void;

    // Provided methods
    fn convert(
        &mut self,
        yuv: &impl ToInputArray,
        color: &mut impl ToOutputArray,
        surface_format: CUDA_SurfaceFormat,
        output_format: CUDA_ColorFormat,
        bit_depth: CUDA_BitDepth,
        planar: bool,
        video_full_range_flag: bool,
        stream: &mut impl StreamTrait,
    ) -> Result<bool> { ... }
    fn convert_def(
        &mut self,
        yuv: &impl ToInputArray,
        color: &mut impl ToOutputArray,
        surface_format: CUDA_SurfaceFormat,
        output_format: CUDA_ColorFormat,
    ) -> Result<bool> { ... }
}
Expand description

Required Methods§

Provided Methods§

Source

fn convert( &mut self, yuv: &impl ToInputArray, color: &mut impl ToOutputArray, surface_format: CUDA_SurfaceFormat, output_format: CUDA_ColorFormat, bit_depth: CUDA_BitDepth, planar: bool, video_full_range_flag: bool, stream: &mut impl StreamTrait, ) -> Result<bool>

Performs the conversion from the raw YUV Surface output from VideoReader to the requested color format. Use this function when you want to convert the raw YUV Surface output from VideoReader to more than one color format or you want both the raw Surface output in addition to a color frame.

§Parameters
  • yuv: The raw YUV Surface output from VideoReader see [SurfaceFormat].
  • color: The converted frame.
  • surfaceFormat: The surface format of the input YUV data.
  • outputFormat: The requested output color format.
  • bitDepth: The requested bit depth of the output frame.
  • planar: Request seperate planes for each color plane.
  • videoFullRangeFlag: Indicates if the black level, luma and chroma of the source are represented using the full or limited range (AKA TV or “analogue” range) of values as defined in Annex E of the ITU-T Specification.
  • stream: Stream for the asynchronous version.
§C++ default parameters
  • bit_depth: BitDepth::UNCHANGED
  • planar: false
  • video_full_range_flag: false
  • stream: cuda::Stream::Null()
Source

fn convert_def( &mut self, yuv: &impl ToInputArray, color: &mut impl ToOutputArray, surface_format: CUDA_SurfaceFormat, output_format: CUDA_ColorFormat, ) -> Result<bool>

Performs the conversion from the raw YUV Surface output from VideoReader to the requested color format. Use this function when you want to convert the raw YUV Surface output from VideoReader to more than one color format or you want both the raw Surface output in addition to a color frame.

§Parameters
  • yuv: The raw YUV Surface output from VideoReader see [SurfaceFormat].
  • color: The converted frame.
  • surfaceFormat: The surface format of the input YUV data.
  • outputFormat: The requested output color format.
  • bitDepth: The requested bit depth of the output frame.
  • planar: Request seperate planes for each color plane.
  • videoFullRangeFlag: Indicates if the black level, luma and chroma of the source are represented using the full or limited range (AKA TV or “analogue” range) of values as defined in Annex E of the ITU-T Specification.
  • stream: Stream for the asynchronous version.
§Note

This alternative version of CUDA_NVSurfaceToColorConverterTrait::convert function uses the following default values for its arguments:

  • bit_depth: BitDepth::UNCHANGED
  • planar: false
  • video_full_range_flag: false
  • stream: cuda::Stream::Null()

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§