Struct opencv::core::GpuMatND

source ·
pub struct GpuMatND { /* private fields */ }

Implementations§

source§

impl GpuMatND

source

pub fn default() -> Result<GpuMatND>

default constructor

source

pub fn new(size: GpuMatND_SizeArray, typ: i32) -> Result<GpuMatND>

default constructor

Overloaded parameters
Parameters
  • size: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_16FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
source

pub unsafe fn new_1( size: GpuMatND_SizeArray, typ: i32, data: *mut c_void, step: GpuMatND_StepArray ) -> Result<GpuMatND>

default constructor

Overloaded parameters
Parameters
  • size: Array of integers specifying an n-dimensional array shape.
  • type: Array type. Use CV_8UC1, …, CV_16FC4 to create 1-4 channel matrices, or CV_8UC(n), …, CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
  • data: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.
  • step: Array of _size.size()-1 steps in case of a multi-dimensional array (the last step is always set to the element size). If not specified, the matrix is assumed to be continuous.
C++ default parameters
  • step: StepArray()
source

pub fn copy(unnamed: &GpuMatND) -> GpuMatND

source

pub fn copy_mut(unnamed: GpuMatND) -> GpuMatND

Trait Implementations§

source§

impl Boxed for GpuMatND

source§

unsafe fn from_raw(ptr: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

Return an the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> *mut c_void

Return the underlying mutable raw pointer Read more
source§

impl Clone for GpuMatND

source§

fn clone(&self) -> Self

Calls try_clone() and panics if that fails

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Drop for GpuMatND

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl GpuMatNDTrait for GpuMatND

source§

fn as_raw_mut_GpuMatND(&mut self) -> *mut c_void

source§

fn set_flags(&mut self, val: i32)

! includes several bit-fields: Read more
source§

fn set_dims(&mut self, val: i32)

matrix dimensionality
source§

fn set_size(&mut self, val: GpuMatND_SizeArray)

shape of this array
source§

fn set_step(&mut self, val: GpuMatND_StepArray)

! step values Their semantics is identical to the semantics of step for Mat.
source§

fn create(&mut self, size: GpuMatND_SizeArray, typ: i32) -> Result<()>

Allocates GPU memory. Suppose there is some GPU memory already allocated. In that case, this method may choose to reuse that GPU memory under the specific condition: it must be of the same size and type, not externally allocated, the GPU memory is continuous(i.e., isContinuous() is true), and is not a sub-matrix of another GpuMatND (i.e., isSubmatrix() is false). In other words, this method guarantees that the GPU memory allocated by this method is always continuous and is not a sub-region of another GpuMatND.
source§

fn release(&mut self) -> Result<()>

source§

fn swap(&mut self, m: &mut GpuMatND)

source§

fn upload(&mut self, src: &dyn ToInputArray) -> Result<()>

source§

fn upload_1(&mut self, src: &dyn ToInputArray, stream: &mut Stream) -> Result<()>

source§

impl GpuMatNDTraitConst for GpuMatND

source§

fn as_raw_GpuMatND(&self) -> *const c_void

source§

fn flags(&self) -> i32

! includes several bit-fields: Read more
source§

fn dims(&self) -> i32

matrix dimensionality
source§

fn size(&self) -> Vector<i32>

shape of this array
source§

fn step(&self) -> Vector<size_t>

! step values Their semantics is identical to the semantics of step for Mat.
source§

fn try_clone(&self) -> Result<GpuMatND>

Creates a full copy of the array and the underlying data. The method creates a full copy of the array. It mimics the behavior of Mat::clone(), i.e. the original step is not taken into account. So, the array copy is a continuous array occupying total()*elemSize() bytes.
source§

fn clone_1(&self, stream: &mut Stream) -> Result<GpuMatND>

Creates a full copy of the array and the underlying data. The method creates a full copy of the array. It mimics the behavior of Mat::clone(), i.e. the original step is not taken into account. So, the array copy is a continuous array occupying total()*elemSize() bytes. Read more
source§

fn apply(&self, ranges: &Vector<Range>) -> Result<GpuMatND>

Extracts a sub-matrix. The operator makes a new header for the specified sub-array of *this. The operator is an O(1) operation, that is, no matrix data is copied. Read more
source§

fn create_gpu_mat_header( &self, idx: GpuMatND_IndexArray, row_range: Range, col_range: Range ) -> Result<GpuMat>

Creates a GpuMat header for a 2D plane part of an n-dim matrix. Read more
source§

fn create_gpu_mat_header_1(&self) -> Result<GpuMat>

Creates a GpuMat header for a 2D plane part of an n-dim matrix. Read more
source§

fn apply_1( &self, idx: GpuMatND_IndexArray, row_range: Range, col_range: Range ) -> Result<GpuMat>

Extracts a 2D plane part of an n-dim matrix. It differs from createGpuMatHeader(IndexArray, Range, Range) in that it clones a part of this GpuMatND to the returned GpuMat. Read more
source§

fn to_gpu_mat(&self) -> Result<GpuMat>

Extracts a 2D plane part of an n-dim matrix if this GpuMatND is effectively 2D. It differs from createGpuMatHeader() in that it clones a part of this GpuMatND. Read more
source§

fn download(&self, dst: &mut dyn ToOutputArray) -> Result<()>

source§

fn download_1( &self, dst: &mut dyn ToOutputArray, stream: &mut Stream ) -> Result<()>

source§

fn is_continuous(&self) -> Result<bool>

returns true iff the GpuMatND data is continuous (i.e. when there are no gaps between successive rows)
source§

fn is_submatrix(&self) -> Result<bool>

returns true if the matrix is a sub-matrix of another matrix
source§

fn elem_size(&self) -> Result<size_t>

returns element size in bytes
source§

fn elem_size1(&self) -> Result<size_t>

returns the size of element channel in bytes
source§

fn empty(&self) -> Result<bool>

returns true if data is null
source§

fn external(&self) -> Result<bool>

returns true if not empty and points to external(user-allocated) gpu memory
source§

fn get_device_ptr(&self) -> Result<*mut u8>

returns pointer to the first byte of the GPU memory
source§

fn total(&self) -> Result<size_t>

returns the total number of array elements
source§

fn total_mem_size(&self) -> Result<size_t>

returns the size of underlying memory in bytes
source§

fn typ(&self) -> Result<i32>

returns element type
source§

impl Send for GpuMatND

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.