pub struct Kernel { /* private fields */ }
Implementations§
Source§impl Kernel
impl Kernel
pub fn default() -> Kernel
pub fn new(kname: &str, prog: &impl ProgramTraitConst) -> Result<Kernel>
Sourcepub fn new_1(
kname: &str,
prog: &impl ProgramSourceTraitConst,
buildopts: &str,
errmsg: &mut String,
) -> Result<Kernel>
pub fn new_1( kname: &str, prog: &impl ProgramSourceTraitConst, buildopts: &str, errmsg: &mut String, ) -> Result<Kernel>
§C++ default parameters
- buildopts: String()
- errmsg: 0
Sourcepub fn new_def(
kname: &str,
prog: &impl ProgramSourceTraitConst,
) -> Result<Kernel>
pub fn new_def( kname: &str, prog: &impl ProgramSourceTraitConst, ) -> Result<Kernel>
§Note
This alternative version of [new] function uses the following default values for its arguments:
- buildopts: String()
- errmsg: 0
pub fn copy(k: &impl KernelTraitConst) -> Result<Kernel>
pub fn copy_mut(k: Kernel) -> Kernel
Trait Implementations§
Source§impl Boxed for Kernel
impl Boxed for Kernel
Source§unsafe fn from_raw(ptr: <Kernel as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <Kernel as OpenCVFromExtern>::ExternReceive) -> Self
Wrap the specified raw pointer Read more
Source§fn into_raw(self) -> <Kernel as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <Kernel as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying raw pointer while consuming this wrapper. Read more
Source§fn as_raw(&self) -> <Kernel as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <Kernel as OpenCVTypeExternContainer>::ExternSend
Return the underlying raw pointer. Read more
Source§fn as_raw_mut(&mut self) -> <Kernel as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <Kernel as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying mutable raw pointer Read more
Source§impl KernelTrait for Kernel
impl KernelTrait for Kernel
fn as_raw_mut_Kernel(&mut self) -> *mut c_void
fn set(&mut self, k: &impl KernelTraitConst) -> Result<()>
fn set_1(&mut self, k: Kernel)
fn create(&mut self, kname: &str, prog: &impl ProgramTraitConst) -> Result<bool>
Source§fn create_ext(
&mut self,
kname: &str,
prog: &impl ProgramSourceTraitConst,
buildopts: &str,
errmsg: &mut String,
) -> Result<bool>
fn create_ext( &mut self, kname: &str, prog: &impl ProgramSourceTraitConst, buildopts: &str, errmsg: &mut String, ) -> Result<bool>
C++ default parameters Read more
Source§fn create_ext_def(
&mut self,
kname: &str,
prog: &impl ProgramSourceTraitConst,
buildopts: &str,
) -> Result<bool>
fn create_ext_def( &mut self, kname: &str, prog: &impl ProgramSourceTraitConst, buildopts: &str, ) -> Result<bool>
Note Read more
unsafe fn set_2( &mut self, i: i32, value: *const c_void, sz: size_t, ) -> Result<i32>
fn set_3(&mut self, i: i32, image_2d: &impl Image2DTraitConst) -> Result<i32>
fn set_umat(&mut self, i: i32, m: &impl UMatTraitConst) -> Result<i32>
fn set_kernel_arg( &mut self, i: i32, arg: &impl KernelArgTraitConst, ) -> Result<i32>
Source§fn run(
&mut self,
globalsize: &mut [size_t],
localsize: &mut [size_t],
sync: bool,
q: &impl QueueTraitConst,
) -> Result<bool>
fn run( &mut self, globalsize: &mut [size_t], localsize: &mut [size_t], sync: bool, q: &impl QueueTraitConst, ) -> Result<bool>
Run the OpenCL kernel (globalsize value may be adjusted) Read more
Source§fn run_def(
&mut self,
globalsize: &mut [size_t],
localsize: &mut [size_t],
sync: bool,
) -> Result<bool>
fn run_def( &mut self, globalsize: &mut [size_t], localsize: &mut [size_t], sync: bool, ) -> Result<bool>
Run the OpenCL kernel (globalsize value may be adjusted) Read more
Source§fn run_(
&mut self,
globalsize: &mut [size_t],
localsize: &mut [size_t],
sync: bool,
q: &impl QueueTraitConst,
) -> Result<bool>
fn run_( &mut self, globalsize: &mut [size_t], localsize: &mut [size_t], sync: bool, q: &impl QueueTraitConst, ) -> Result<bool>
Run the OpenCL kernel Read more
Source§fn run__def(
&mut self,
globalsize: &mut [size_t],
localsize: &mut [size_t],
sync: bool,
) -> Result<bool>
fn run__def( &mut self, globalsize: &mut [size_t], localsize: &mut [size_t], sync: bool, ) -> Result<bool>
Run the OpenCL kernel Read more
Source§fn run_task(&mut self, sync: bool, q: &impl QueueTraitConst) -> Result<bool>
fn run_task(&mut self, sync: bool, q: &impl QueueTraitConst) -> Result<bool>
C++ default parameters Read more
Source§fn run_profiling(
&mut self,
globalsize: &mut [size_t],
localsize: &mut [size_t],
q: &impl QueueTraitConst,
) -> Result<i64>
fn run_profiling( &mut self, globalsize: &mut [size_t], localsize: &mut [size_t], q: &impl QueueTraitConst, ) -> Result<i64>
Similar to synchronized run_() call with returning of kernel execution time Read more
Source§impl KernelTraitConst for Kernel
impl KernelTraitConst for Kernel
fn as_raw_Kernel(&self) -> *const c_void
fn empty(&self) -> Result<bool>
fn work_group_size(&self) -> Result<size_t>
fn prefered_work_group_size_multiple(&self) -> Result<size_t>
fn compile_work_group_size(&self, wsz: &mut [size_t]) -> Result<bool>
fn local_mem_size(&self) -> Result<size_t>
fn ptr(&self) -> Result<*mut c_void>
impl Send for Kernel
Auto Trait Implementations§
impl Freeze for Kernel
impl RefUnwindSafe for Kernel
impl !Sync for Kernel
impl Unpin for Kernel
impl UnwindSafe for Kernel
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
Mutably borrows from an owned value. Read more
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
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