pub struct Texture2D { /* private fields */ }
Expand description
Smart pointer for OpenGL 2D texture memory with reference counting.
Implementations§
source§impl Texture2D
impl Texture2D
sourcepub fn default() -> Result<Texture2D>
pub fn default() -> Result<Texture2D>
The constructors.
Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from host/device memory.
sourcepub fn new(
arows: i32,
acols: i32,
aformat: Texture2D_Format,
atex_id: u32,
auto_release: bool
) -> Result<Texture2D>
pub fn new( arows: i32, acols: i32, aformat: Texture2D_Format, atex_id: u32, auto_release: bool ) -> Result<Texture2D>
sourcepub fn new_def(
arows: i32,
acols: i32,
aformat: Texture2D_Format,
atex_id: u32
) -> Result<Texture2D>
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
sourcepub fn new_1(
asize: Size,
aformat: Texture2D_Format,
atex_id: u32,
auto_release: bool
) -> Result<Texture2D>
pub fn new_1( asize: Size, aformat: Texture2D_Format, atex_id: u32, auto_release: bool ) -> Result<Texture2D>
sourcepub fn new_def_1(
asize: Size,
aformat: Texture2D_Format,
atex_id: u32
) -> Result<Texture2D>
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
sourcepub fn new_2(
arows: i32,
acols: i32,
aformat: Texture2D_Format,
auto_release: bool
) -> Result<Texture2D>
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
sourcepub fn new_def_2(
arows: i32,
acols: i32,
aformat: Texture2D_Format
) -> Result<Texture2D>
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
sourcepub fn new_3(
asize: Size,
aformat: Texture2D_Format,
auto_release: bool
) -> Result<Texture2D>
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
sourcepub fn new_def_3(asize: Size, aformat: Texture2D_Format) -> Result<Texture2D>
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
sourcepub fn new_4(arr: &impl ToInputArray, auto_release: bool) -> Result<Texture2D>
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
sourcepub fn new_def_4(arr: &impl ToInputArray) -> Result<Texture2D>
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
impl Boxed for Texture2D
source§unsafe fn from_raw(ptr: <Texture2D as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <Texture2D as OpenCVFromExtern>::ExternReceive) -> Self
source§fn into_raw(self) -> <Texture2D as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <Texture2D as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <Texture2D as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <Texture2D as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(
&mut self
) -> <Texture2D as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <Texture2D as OpenCVTypeExternContainer>::ExternSendMut
source§impl Texture2DTrait for Texture2D
impl Texture2DTrait for Texture2D
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<()>
fn create( &mut self, arows: i32, acols: i32, aformat: Texture2D_Format, auto_release: bool ) -> Result<()>
source§fn create_def(
&mut self,
arows: i32,
acols: i32,
aformat: Texture2D_Format
) -> Result<()>
fn create_def( &mut self, arows: i32, acols: i32, aformat: Texture2D_Format ) -> Result<()>
source§fn create_1(
&mut self,
asize: Size,
aformat: Texture2D_Format,
auto_release: bool
) -> Result<()>
fn create_1( &mut self, asize: Size, aformat: Texture2D_Format, auto_release: bool ) -> Result<()>
source§fn create_def_1(&mut self, asize: Size, aformat: Texture2D_Format) -> Result<()>
fn create_def_1(&mut self, asize: Size, aformat: Texture2D_Format) -> Result<()>
source§fn release(&mut self) -> Result<()>
fn release(&mut self) -> Result<()>
source§fn copy_from(
&mut self,
arr: &impl ToInputArray,
auto_release: bool
) -> Result<()>
fn copy_from( &mut self, arr: &impl ToInputArray, auto_release: bool ) -> Result<()>
source§fn copy_from_def(&mut self, arr: &impl ToInputArray) -> Result<()>
fn copy_from_def(&mut self, arr: &impl ToInputArray) -> Result<()>
source§impl Texture2DTraitConst for Texture2D
impl Texture2DTraitConst for Texture2D
fn as_raw_Texture2D(&self) -> *const c_void
source§fn copy_to(
&self,
arr: &mut impl ToOutputArray,
ddepth: i32,
auto_release: bool
) -> Result<()>
fn copy_to( &self, arr: &mut impl ToOutputArray, ddepth: i32, auto_release: bool ) -> Result<()>
source§fn copy_to_def(&self, arr: &mut impl ToOutputArray) -> Result<()>
fn copy_to_def(&self, arr: &mut impl ToOutputArray) -> Result<()>
source§fn bind(&self) -> Result<()>
fn bind(&self) -> Result<()>
fn rows(&self) -> Result<i32>
fn cols(&self) -> Result<i32>
fn size(&self) -> Result<Size>
fn empty(&self) -> Result<bool>
fn format(&self) -> Result<Texture2D_Format>
impl Send for Texture2D
Auto Trait Implementations§
impl Freeze for Texture2D
impl RefUnwindSafe for Texture2D
impl !Sync for Texture2D
impl Unpin for Texture2D
impl UnwindSafe for Texture2D
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
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