[][src]Trait opencv::core::prelude::Texture2DTrait

pub trait Texture2DTrait {
    pub fn as_raw_Texture2D(&self) -> *const c_void;
pub fn as_raw_mut_Texture2D(&mut self) -> *mut c_void; pub fn create(
        &mut self,
        arows: i32,
        acols: i32,
        aformat: Texture2D_Format,
        auto_release: bool
    ) -> Result<()> { ... }
pub fn create_1(
        &mut self,
        asize: Size,
        aformat: Texture2D_Format,
        auto_release: bool
    ) -> Result<()> { ... }
pub fn release(&mut self) -> Result<()> { ... }
pub fn set_auto_release(&mut self, flag: bool) -> Result<()> { ... }
pub fn copy_from(
        &mut self,
        arr: &dyn ToInputArray,
        auto_release: bool
    ) -> Result<()> { ... }
pub fn copy_to(
        &self,
        arr: &mut dyn ToOutputArray,
        ddepth: i32,
        auto_release: bool
    ) -> Result<()> { ... }
pub fn bind(&self) -> Result<()> { ... }
pub fn rows(&self) -> Result<i32> { ... }
pub fn cols(&self) -> Result<i32> { ... }
pub fn size(&self) -> Result<Size> { ... }
pub fn empty(&self) -> Result<bool> { ... }
pub fn format(&self) -> Result<Texture2D_Format> { ... }
pub fn tex_id(&self) -> Result<u32> { ... } }

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

Required methods

Loading content...

Provided methods

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

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

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

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

pub fn release(&mut self) -> Result<()>[src]

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

The function will call setAutoRelease(true) .

pub fn set_auto_release(&mut self, flag: bool) -> Result<()>[src]

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.

pub fn copy_from(
    &mut self,
    arr: &dyn ToInputArray,
    auto_release: bool
) -> Result<()>
[src]

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

pub fn copy_to(
    &self,
    arr: &mut dyn ToOutputArray,
    ddepth: i32,
    auto_release: bool
) -> Result<()>
[src]

Copies from OpenGL texture to host/device memory or another OpenGL texture object.

Parameters

  • arr: Destination array (host or device memory, can be Mat , cuda::GpuMat , ogl::Buffer or ogl::Texture2D ).
  • ddepth: Destination depth.
  • autoRelease: Auto release mode for destination buffer (if arr is OpenGL buffer or texture).

C++ default parameters

  • ddepth: CV_32F
  • auto_release: false

pub fn bind(&self) -> Result<()>[src]

Binds texture to current active texture unit for GL_TEXTURE_2D target.

pub fn rows(&self) -> Result<i32>[src]

pub fn cols(&self) -> Result<i32>[src]

pub fn size(&self) -> Result<Size>[src]

pub fn empty(&self) -> Result<bool>[src]

pub fn format(&self) -> Result<Texture2D_Format>[src]

pub fn tex_id(&self) -> Result<u32>[src]

get OpenGL opject id

Loading content...

Implementors

impl Texture2DTrait for Texture2D[src]

Loading content...