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