Struct opencv::core::Texture2D

source ·
pub struct Texture2D { /* private fields */ }
Expand description

Smart pointer for OpenGL 2D texture memory with reference counting.

Implementations§

source§

impl Texture2D

source

pub fn default() -> Result<Texture2D>

The constructors.

Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from host/device memory.

source

pub fn new( arows: i32, acols: i32, aformat: Texture2D_Format, atex_id: u32, auto_release: bool ) -> Result<Texture2D>

The constructors.

Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from host/device memory.

§Overloaded parameters
§C++ default parameters
  • auto_release: false
source

pub fn new_def( arows: i32, acols: i32, aformat: Texture2D_Format, atex_id: u32 ) -> Result<Texture2D>

@overload

§Note

This alternative version of [new] function uses the following default values for its arguments:

  • auto_release: false
source

pub fn new_1( asize: Size, aformat: Texture2D_Format, atex_id: u32, auto_release: bool ) -> Result<Texture2D>

The constructors.

Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from host/device memory.

§Overloaded parameters
§C++ default parameters
  • auto_release: false
source

pub fn new_def_1( asize: Size, aformat: Texture2D_Format, atex_id: u32 ) -> Result<Texture2D>

@overload

§Note

This alternative version of [new] function uses the following default values for its arguments:

  • auto_release: false
source

pub fn new_2( arows: i32, acols: i32, aformat: Texture2D_Format, auto_release: bool ) -> Result<Texture2D>

The constructors.

Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from host/device memory.

§Overloaded parameters
§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

pub fn new_def_2( arows: i32, acols: i32, aformat: Texture2D_Format ) -> Result<Texture2D>

@overload

§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 [new] function uses the following default values for its arguments:

  • auto_release: false
source

pub fn new_3( asize: Size, aformat: Texture2D_Format, auto_release: bool ) -> Result<Texture2D>

The constructors.

Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from host/device memory.

§Overloaded parameters
§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

pub fn new_def_3(asize: Size, aformat: Texture2D_Format) -> Result<Texture2D>

@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 [new] function uses the following default values for its arguments:

  • auto_release: false
source

pub fn new_4(arr: &impl ToInputArray, auto_release: bool) -> Result<Texture2D>

The constructors.

Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from host/device memory.

§Overloaded parameters
§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

pub fn new_def_4(arr: &impl ToInputArray) -> Result<Texture2D>

@overload

§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 [new] function uses the following default values for its arguments:

  • auto_release: false

Trait Implementations§

source§

impl Boxed for Texture2D

source§

unsafe fn from_raw(ptr: <Texture2D as OpenCVFromExtern>::ExternReceive) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> <Texture2D as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> <Texture2D as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
source§

fn as_raw_mut( &mut self ) -> <Texture2D as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
source§

impl Debug for Texture2D

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Texture2D

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Texture2DTrait for Texture2D

source§

fn as_raw_mut_Texture2D(&mut self) -> *mut c_void

source§

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

Allocates memory for ogl::Texture2D object. Read more
source§

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

Allocates memory for ogl::Texture2D object. Read more
source§

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

Allocates memory for ogl::Texture2D object. Read more
source§

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

@overload Read more
source§

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

Decrements the reference counter and destroys the texture object if needed. Read more
source§

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

Sets auto release mode. Read more
source§

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

Copies from host/device memory to OpenGL texture. Read more
source§

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

Copies from host/device memory to OpenGL texture. Read more
source§

impl Texture2DTraitConst for Texture2D

source§

fn as_raw_Texture2D(&self) -> *const c_void

source§

fn copy_to( &self, arr: &mut impl ToOutputArray, ddepth: i32, auto_release: bool ) -> Result<()>

Copies from OpenGL texture to host/device memory or another OpenGL texture object. Read more
source§

fn copy_to_def(&self, arr: &mut impl ToOutputArray) -> Result<()>

Copies from OpenGL texture to host/device memory or another OpenGL texture object. Read more
source§

fn bind(&self) -> Result<()>

Binds texture to current active texture unit for GL_TEXTURE_2D target.
source§

fn rows(&self) -> Result<i32>

source§

fn cols(&self) -> Result<i32>

source§

fn size(&self) -> Result<Size>

source§

fn empty(&self) -> Result<bool>

source§

fn format(&self) -> Result<Texture2D_Format>

source§

fn tex_id(&self) -> Result<u32>

get OpenGL opject id
source§

impl Send for Texture2D

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Mat> ModifyInplace for Mat
where Mat: Boxed,

source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a Mat or another similar object. By passing a mutable reference to the Mat to this function your closure will get called with the read reference and a write references to the same Mat. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.