Struct 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 unsafe in a general case as it leads to having non-exclusive mutable access to the internal data, but it can 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>,

Source§

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>,

Source§

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.