pub struct Mat { /* private fields */ }
Implementations
sourceimpl Mat
impl Mat
sourcepub fn new_2d(w: i32, h: i32, alloc: Option<&Allocator>) -> Self
pub fn new_2d(w: i32, h: i32, alloc: Option<&Allocator>) -> Self
Constructs an empty 2D matrix.
sourcepub fn new_3d(w: i32, h: i32, c: i32, alloc: Option<&Allocator>) -> Self
pub fn new_3d(w: i32, h: i32, c: i32, alloc: Option<&Allocator>) -> Self
Constructs an empty 3D matrix.
sourcepub fn new_4d(w: i32, h: i32, d: i32, c: i32, alloc: Option<&Allocator>) -> Self
pub fn new_4d(w: i32, h: i32, d: i32, c: i32, alloc: Option<&Allocator>) -> Self
Constructs an empty 4D matrix.
sourcepub unsafe fn new_external_1d(
w: i32,
data: *mut c_void,
alloc: Option<&Allocator>
) -> Self
pub unsafe fn new_external_1d(
w: i32,
data: *mut c_void,
alloc: Option<&Allocator>
) -> Self
Constructs 1D matrix with a given raw data.
Safety
Data pointer must not be aliased, it must be valid for the entire lifetime of Mat and it must be of correct size.
sourcepub unsafe fn new_external_2d(
w: i32,
h: i32,
data: *mut c_void,
alloc: Option<&Allocator>
) -> Self
pub unsafe fn new_external_2d(
w: i32,
h: i32,
data: *mut c_void,
alloc: Option<&Allocator>
) -> Self
Constructs 2D matrix with a given raw data.
Safety
Data pointer must not be aliased, it must be valid for the entire lifetime of Mat and it must be of correct size.
sourcepub unsafe fn new_external_3d(
w: i32,
h: i32,
c: i32,
data: *mut c_void,
alloc: Option<&Allocator>
) -> Self
pub unsafe fn new_external_3d(
w: i32,
h: i32,
c: i32,
data: *mut c_void,
alloc: Option<&Allocator>
) -> Self
Constructs 3D matrix with a given raw data.
Safety
Data pointer must not be aliased, it must be valid for the entire lifetime of Mat and it must be of correct size.
sourcepub unsafe fn new_external_4d(
w: i32,
h: i32,
d: i32,
c: i32,
data: *mut c_void,
alloc: Option<&Allocator>
) -> Self
pub unsafe fn new_external_4d(
w: i32,
h: i32,
d: i32,
c: i32,
data: *mut c_void,
alloc: Option<&Allocator>
) -> Self
Constructs 4D matrix with a given raw data.
Safety
Data pointer must not be aliased, it must be valid for the entire lifetime of Mat and it must be of correct size.
sourcepub fn from_pixels(
data: &[u8],
pixel_type: MatPixelType,
width: i32,
height: i32,
alloc: Option<&Allocator>
) -> Result<Mat>
pub fn from_pixels(
data: &[u8],
pixel_type: MatPixelType,
width: i32,
height: i32,
alloc: Option<&Allocator>
) -> Result<Mat>
Constructs matrix from pixel byte array