Class representing 1 to 4-channel matrix of float or uchar, stored on CPU and/or GPU side. More...
Functions | |
Mat () | |
Default constructor. More... | |
Mat (System.IntPtr ptr) | |
Constructor. More... | |
Mat (sl.Resolution resolution, MAT_TYPE type, MEM mem=MEM.CPU) | |
Constructor. More... | |
void | Create (sl.Resolution resolution, MAT_TYPE type, MEM mem=MEM.CPU) |
Creates a sl.Mat with a given sl.Resolution. More... | |
void | Create (uint width, uint height, MAT_TYPE type, MEM mem=MEM.CPU) |
Creates a Mat with a given width and height. More... | |
bool | IsInit () |
Whether the sl.Mat has been initialized. More... | |
void | Free (MEM mem=(MEM.GPU|MEM.CPU)) |
Frees the memory of the sl.Mat. More... | |
sl.ERROR_CODE | UpdateCPUFromGPU () |
Copies data from the GPU to the CPU, if possible. More... | |
sl.ERROR_CODE | UpdateGPUFromCPU () |
Copies data from the CPU to the GPU, if possible. More... | |
string | GetInfos () |
Returns the information about the sl::Mat into a string. More... | |
sl.ERROR_CODE | CopyTo (sl.Mat dest, sl.COPY_TYPE copyType=COPY_TYPE.CPU_CPU) |
Copies data from this sl.Mat to another sl.Mat (deep copy). More... | |
sl.ERROR_CODE | Read (string filePath) |
Reads an image from a file. More... | |
sl.ERROR_CODE | Write (string filePath, int compressionLevel=-1) |
Writes the sl.Mat into a file as an image. More... | |
int | GetWidth () |
Returns the width of the matrix. More... | |
int | GetHeight () |
Returns the height of the matrix. More... | |
int | GetChannels () |
Returns the number of values stored in one pixel. More... | |
int | GetPixelBytes () |
Returns the size of one pixel in bytes. More... | |
int | GetStep (sl.MEM mem=sl.MEM.CPU) |
Returns the memory step in number of elements (size in one pixel row). More... | |
int | GetStepBytes (sl.MEM mem=sl.MEM.CPU) |
Returns the memory step in bytes (size of one pixel row). More... | |
int | GetWidthBytes () |
Returns the size of a row in bytes. More... | |
MEM | GetMemoryType () |
Returns the type of memory (CPU and/or GPU). More... | |
bool | IsMemoryOwner () |
Returns whether the sl.Mat is the owner of the memory it accesses. More... | |
sl.Resolution | GetResolution () |
Returns the resolution (width and height) of the matrix. More... | |
void | Alloc (uint width, uint height, MAT_TYPE matType, MEM mem=MEM.CPU) |
Allocates the sl.Mat memory. More... | |
void | Alloc (sl.Resolution resolution, MAT_TYPE matType, MEM mem=MEM.CPU) |
Allocates the sl.Mat memory. More... | |
int | SetFrom (Mat src, COPY_TYPE copyType=COPY_TYPE.CPU_CPU) |
Copies data from another sl.Mat into this one (deep copy). More... | |
System.IntPtr | GetPtr (MEM mem=MEM.CPU) |
Returns the CPU or GPU data pointer. More... | |
void | Clone (Mat source) |
Duplicates a sl.Mat by copying all its data into a new one (deep copy). More... | |
sl.ERROR_CODE | GetValue (int x, int y, out float value, sl.MEM mem=sl.MEM.CPU) |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C1. More... | |
sl.ERROR_CODE | GetValue (int x, int y, out float2 value, sl.MEM mem=sl.MEM.CPU) |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C2. More... | |
sl.ERROR_CODE | GetValue (int x, int y, out float3 value, sl.MEM mem=sl.MEM.CPU) |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C3. More... | |
sl.ERROR_CODE | GetValue (int x, int y, out float4 value, sl.MEM mem=sl.MEM.CPU) |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C4. More... | |
sl.ERROR_CODE | GetValue (int x, int y, out byte value, sl.MEM mem=sl.MEM.CPU) |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C1. More... | |
sl.ERROR_CODE | GetValue (int x, int y, out char2 value, sl.MEM mem=sl.MEM.CPU) |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C2. More... | |
sl.ERROR_CODE | GetValue (int x, int y, out char3 value, sl.MEM mem=sl.MEM.CPU) |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C3. More... | |
sl.ERROR_CODE | GetValue (int x, int y, out char4 value, sl.MEM mem=sl.MEM.CPU) |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C4. More... | |
sl.ERROR_CODE | SetValue (int x, int y, ref float value, sl.MEM mem=sl.MEM.CPU) |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C1. More... | |
sl.ERROR_CODE | SetValue (int x, int y, ref float2 value, sl.MEM mem=sl.MEM.CPU) |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C2. More... | |
sl.ERROR_CODE | SetValue (int x, int y, ref float3 value, sl.MEM mem=sl.MEM.CPU) |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C3. More... | |
sl.ERROR_CODE | SetValue (int x, int y, float4 value, sl.MEM mem=sl.MEM.CPU) |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C4. More... | |
sl.ERROR_CODE | SetValue (int x, int y, ref byte value, sl.MEM mem=sl.MEM.CPU) |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C1. More... | |
sl.ERROR_CODE | SetValue (int x, int y, ref char2 value, sl.MEM mem=sl.MEM.CPU) |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C2. More... | |
sl.ERROR_CODE | SetValue (int x, int y, ref char3 value, sl.MEM mem=sl.MEM.CPU) |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C3. More... | |
sl.ERROR_CODE | SetValue (int x, int y, ref char4 value, sl.MEM mem=sl.MEM.CPU) |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C4. More... | |
sl.ERROR_CODE | SetTo (ref float value, sl.MEM mem) |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_32F_C1 with the given value. More... | |
sl.ERROR_CODE | SetTo (ref float2 value, sl.MEM mem) |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_32F_C2 with the given value. More... | |
sl.ERROR_CODE | SetTo (ref float3 value, sl.MEM mem) |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_32F_C3 with the given value. More... | |
sl.ERROR_CODE | SetTo (ref float4 value, sl.MEM mem) |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_32F_C4 with the given value. More... | |
sl.ERROR_CODE | SetTo (ref byte value, sl.MEM mem) |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_8U_C1 with the given value. More... | |
sl.ERROR_CODE | SetTo (ref char2 value, sl.MEM mem) |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_8U_C2 with the given value. More... | |
sl.ERROR_CODE | SetTo (ref char3 value, sl.MEM mem) |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_8U_C3 with the given value. More... | |
sl.ERROR_CODE | SetTo (ref char4 value, sl.MEM mem) |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_8U_C4 with the given value. More... | |
Properties | |
IntPtr | MatPtr [get] |
Returns the internal ptr of a Mat. More... | |
Class representing 1 to 4-channel matrix of float or uchar, stored on CPU and/or GPU side.
This class is defined in a row-major order, meaning that for an image buffer, the rows are stored consecutively from top to bottom.
|
inline |
|
inline |
Constructor.
Creates a sl.Mat with a given sl.Resolution.
resolution | Size of the matrix in pixels. |
type | Type of the matrix. Depends on texture type (see sl.VIEW and sl.MEASURE). |
mem | Where the buffer will be stored (CPU or GPU memory). Choose depending on where you'll need to access it from. |
|
inline |
Creates a sl.Mat with a given sl.Resolution.
resolution | Size of the matrix in pixels. |
type | Type of the matrix. Depends on texture type (see sl.VIEW and sl.MEASURE). |
mem | Where the buffer will be stored (CPU or GPU memory). Choose depending on where you'll need to access it from. |
Creates a Mat with a given width and height.
width | Width of the matrix in pixels. |
height | Height of the matrix in pixels.. |
type | Type of the matrix. Depends on texture type (see sl.VIEW and sl.MEASURE). |
mem | Where the buffer will be stored (CPU or GPU memory). Choose depending on where you'll need to access it from. |
|
inline |
Whether the sl.Mat has been initialized.
|
inline |
Copies data from the GPU to the CPU, if possible.
|
inline |
Copies data from the CPU to the GPU, if possible.
|
inline |
|
inline |
Copies data from this sl.Mat to another sl.Mat (deep copy).
dest | sl.Mat that the data will be copied to. |
copyType | The to and from memory types. |
|
inline |
Reads an image from a file.
Supports .png and .jpeg.
filePath | Path of the file to read (including the name and extension). |
|
inline |
Writes the sl.Mat into a file as an image.
filePath | Path of the file to write in (including the name and extension). |
compression_level | Compression level used. Highest value means highest compression (smaller size). Range [0 - 100]. |
|
inline |
Returns the width of the matrix.
|
inline |
Returns the height of the matrix.
|
inline |
Returns the number of values stored in one pixel.
|
inline |
Returns the size of one pixel in bytes.
|
inline |
Returns the memory step in number of elements (size in one pixel row).
|
inline |
Returns the memory step in bytes (size of one pixel row).
|
inline |
Returns the size of a row in bytes.
|
inline |
Returns the type of memory (CPU and/or GPU).
|
inline |
Returns whether the sl.Mat is the owner of the memory it accesses.
|
inline |
Returns the resolution (width and height) of the matrix.
Allocates the sl.Mat memory.
width | Width of the image/matrix in pixels. |
height | Height of the image/matrix in pixels. |
matType | Type of matrix (data type and channels - see sl.MAT_TYPE) |
mem | Where the buffer will be stored - CPU memory or GPU memory. |
|
inline |
Allocates the sl.Mat memory.
resolution | Size of the image/matrix in pixels. |
matType | Type of matrix (data type and channels - see sl.MAT_TYPE) |
mem | Where the buffer will be stored - CPU memory or GPU memory. |
|
inline |
Copies data from another sl.Mat into this one (deep copy).
src | sl.Mat where the data will be copied from. |
copyType | Specifies the memory that will be used for the copy. |
Returns the CPU or GPU data pointer.
mem | Specifies whether you want sl.MEM.CPU or sl.MEM.GPU. |
|
inline |
|
inline |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C1.
x | Column of the point to get the value from. |
y | Row of the point to get the value from. |
value | Gets filled with the current value. |
mem | Which memory should be read. |
|
inline |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C2.
x | Column of the point to get the value from. |
y | Row of the point to get the value from. |
value | Gets filled with the current value. |
mem | Which memory should be read. |
|
inline |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C3.
x | Column of the point to get the value from. |
y | Row of the point to get the value from. |
value | Gets filled with the current value. |
mem | Which memory should be read. |
|
inline |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C4.
x | Column of the point to get the value from. |
y | Row of the point to get the value from. |
value | Gets filled with the current value. |
mem | Which memory should be read. |
|
inline |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C1.
x | Column of the point to get the value from. |
y | Row of the point to get the value from. |
value | Gets filled with the current value. |
mem | Which memory should be read. |
|
inline |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C2.
x | Column of the point to get the value from. |
y | Row of the point to get the value from. |
value | Gets filled with the current value. |
mem | Which memory should be read. |
|
inline |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C3.
x | Column of the point to get the value from. |
y | Row of the point to get the value from. |
value | Gets filled with the current value. |
mem | Which memory should be read. |
|
inline |
Returns the value of a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C4.
x | Column of the point to get the value from. |
y | Row of the point to get the value from. |
value | Gets filled with the current value. |
mem | Which memory should be read. |
|
inline |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C1.
x | Column of the point to set the value. |
y | Row of the point to set the value. |
value | Value to which the point will be set. |
mem | Which memory will be updated. |
|
inline |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C2.
x | Column of the point to set the value. |
y | Row of the point to set the value. |
value | Value to which the point will be set. |
mem | Which memory will be updated. |
|
inline |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C3.
x | Column of the point to set the value. |
y | Row of the point to set the value. |
value | Value to which the point will be set. |
mem | Which memory will be updated. |
|
inline |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_32F_C4.
x | Column of the point to set the value. |
y | Row of the point to set the value. |
value | Value to which the point will be set. |
mem | Which memory will be updated. |
|
inline |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C1.
x | Column of the point to set the value. |
y | Row of the point to set the value. |
value | Value to which the point will be set. |
mem | Which memory will be updated. |
|
inline |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C2.
x | Column of the point to set the value. |
y | Row of the point to set the value. |
value | Value to which the point will be set. |
mem | Which memory will be updated. |
|
inline |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C3.
x | Column of the point to set the value. |
y | Row of the point to set the value. |
value | Value to which the point will be set. |
mem | Which memory will be updated. |
|
inline |
Sets a value to a specific point in the matrix of type sl.MAT_TYPE.MAT_8U_C4.
x | Column of the point to set the value. |
y | Row of the point to set the value. |
value | Value to which the point will be set. |
mem | Which memory will be updated. |
|
inline |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_32F_C1 with the given value.
value | Value to be copied all over the matrix. |
mem | Which buffer to fill, CPU and/or GPU. |
|
inline |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_32F_C2 with the given value.
value | Value to be copied all over the matrix. |
mem | Which buffer to fill, CPU and/or GPU. |
|
inline |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_32F_C3 with the given value.
value | Value to be copied all over the matrix. |
mem | Which buffer to fill, CPU and/or GPU. |
|
inline |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_32F_C4 with the given value.
value | Value to be copied all over the matrix. |
mem | Which buffer to fill, CPU and/or GPU. |
|
inline |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_8U_C1 with the given value.
value | Value to be copied all over the matrix. |
mem | Which buffer to fill, CPU and/or GPU. |
|
inline |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_8U_C2 with the given value.
value | Value to be copied all over the matrix. |
mem | Which buffer to fill, CPU and/or GPU. |
|
inline |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_8U_C3 with the given value.
value | Value to be copied all over the matrix. |
mem | Which buffer to fill, CPU and/or GPU. |
|
inline |
Fills the entire sl.Mat of type sl.MAT_TYPE.MAT_8U_C4 with the given value.
value | Value to be copied all over the matrix. |
mem | Which buffer to fill, CPU and/or GPU. |
|
get |
Returns the internal ptr of a Mat.
Referenced by Fusion.RetrieveImage(), and Fusion.RetrieveMeasure().