Trait opencv::core::Texture2DTrait

source ·
pub trait Texture2DTrait: Texture2DTraitConst {
    // Required method
    fn as_raw_mut_Texture2D(&mut self) -> *mut c_void;

    // Provided methods
    fn create(
        &mut self,
        arows: i32,
        acols: i32,
        aformat: Texture2D_Format,
        auto_release: bool
    ) -> Result<()> { ... }
    fn create_def(
        &mut self,
        arows: i32,
        acols: i32,
        aformat: Texture2D_Format
    ) -> Result<()> { ... }
    fn create_1(
        &mut self,
        asize: Size,
        aformat: Texture2D_Format,
        auto_release: bool
    ) -> Result<()> { ... }
    fn create_def_1(
        &mut self,
        asize: Size,
        aformat: Texture2D_Format
    ) -> Result<()> { ... }
    fn release(&mut self) -> Result<()> { ... }
    fn set_auto_release(&mut self, flag: bool) -> Result<()> { ... }
    fn copy_from(
        &mut self,
        arr: &impl ToInputArray,
        auto_release: bool
    ) -> Result<()> { ... }
    fn copy_from_def(&mut self, arr: &impl ToInputArray) -> Result<()> { ... }
}
Expand description

Mutable methods for core::Texture2D

Required Methods§

Provided Methods§

source

fn create( &mut self, arows: i32, acols: i32, aformat: Texture2D_Format, auto_release: bool ) -> Result<()>

Allocates memory for ogl::Texture2D object.

§Parameters
  • arows: Number of rows.
  • acols: Number of columns.
  • aformat: Image format. See cv::ogl::Texture2D::Format .
  • autoRelease: Auto release mode (if true, release will be called in object’s destructor).
§C++ default parameters
  • auto_release: false
source

fn create_def( &mut self, arows: i32, acols: i32, aformat: Texture2D_Format ) -> Result<()>

Allocates memory for ogl::Texture2D object.

§Parameters
  • arows: Number of rows.
  • acols: Number of columns.
  • aformat: Image format. See cv::ogl::Texture2D::Format .
  • autoRelease: Auto release mode (if true, release will be called in object’s destructor).
§Note

This alternative version of Texture2DTrait::create function uses the following default values for its arguments:

  • auto_release: false
source

fn create_1( &mut self, asize: Size, aformat: Texture2D_Format, auto_release: bool ) -> Result<()>

Allocates memory for ogl::Texture2D object.

§Parameters
  • arows: Number of rows.
  • acols: Number of columns.
  • aformat: Image format. See cv::ogl::Texture2D::Format .
  • autoRelease: Auto release mode (if true, release will be called in object’s destructor).
§Overloaded parameters
  • asize: 2D array size.
  • aformat: Image format. See cv::ogl::Texture2D::Format .
  • autoRelease: Auto release mode (if true, release will be called in object’s destructor).
§C++ default parameters
  • auto_release: false
source

fn create_def_1(&mut self, asize: Size, aformat: Texture2D_Format) -> Result<()>

@overload

§Parameters
  • asize: 2D array size.
  • aformat: Image format. See cv::ogl::Texture2D::Format .
  • autoRelease: Auto release mode (if true, release will be called in object’s destructor).
§Note

This alternative version of Texture2DTrait::create function uses the following default values for its arguments:

  • auto_release: false
source

fn release(&mut self) -> Result<()>

Decrements the reference counter and destroys the texture object if needed.

The function will call setAutoRelease(true) .

source

fn set_auto_release(&mut self, flag: bool) -> Result<()>

Sets auto release mode.

§Parameters
  • flag: Auto release mode (if true, release will be called in object’s destructor).

The lifetime of the OpenGL object is tied to the lifetime of the context. If OpenGL context was bound to a window it could be released at any time (user can close a window). If object’s destructor is called after destruction of the context it will cause an error. Thus ogl::Texture2D doesn’t destroy OpenGL object in destructor by default (all OpenGL resources will be released with OpenGL context). This function can force ogl::Texture2D destructor to destroy OpenGL object.

source

fn copy_from( &mut self, arr: &impl ToInputArray, auto_release: bool ) -> Result<()>

Copies from host/device memory to OpenGL texture.

§Parameters
  • arr: Input array (host or device memory, it can be Mat , cuda::GpuMat or ogl::Buffer ).
  • autoRelease: Auto release mode (if true, release will be called in object’s destructor).
§C++ default parameters
  • auto_release: false
source

fn copy_from_def(&mut self, arr: &impl ToInputArray) -> Result<()>

Copies from host/device memory to OpenGL texture.

§Parameters
  • arr: Input array (host or device memory, it can be Mat , cuda::GpuMat or ogl::Buffer ).
  • autoRelease: Auto release mode (if true, release will be called in object’s destructor).
§Note

This alternative version of Texture2DTrait::copy_from function uses the following default values for its arguments:

  • auto_release: false

Object Safety§

This trait is not object safe.

Implementors§