![]() |
Zivid C++ API 2.18.0+1b44dbef-1
|
A mask for filtering point cloud data. More...
#include <Zivid/Mask.h>
Public Member Functions | |
| ZIVID_UTILS_EXPORT | Mask () |
| Create an empty mask. | |
| ZIVID_UTILS_EXPORT | Mask (const Resolution &resolution) |
| Create a nonzero-filled mask with the specified resolution. | |
| ZIVID_UTILS_EXPORT | Mask (const Resolution &resolution, const uint8_t *beginIt, const uint8_t *endIt) |
| Create a mask from third-party mask data (e.g., OpenCV Mat) | |
| template<typename Iterator, typename std::enable_if_t< std::is_convertible_v< typename std::iterator_traits< Iterator >::value_type, uint8_t >, std::nullptr_t > = nullptr> | |
| Mask (const Resolution &resolution, Iterator beginIt, Iterator endIt) | |
| Create a mask from iterator range. | |
| ZIVID_UTILS_EXPORT Resolution | resolution () const |
| Get the resolution of the mask. | |
| ZIVID_UTILS_EXPORT std::string | toString () const |
| Get string representation of the mask. | |
| ZIVID_UTILS_EXPORT uint8_t * | data () |
| Mutable pointer to the first data element of the mask. | |
| ZIVID_UTILS_EXPORT const uint8_t * | data () const |
| Const pointer to the first data element of the mask. | |
| ZIVID_UTILS_EXPORT uint8_t * | begin () |
| Mutable iterator to the beginning of the mask. | |
| ZIVID_UTILS_EXPORT uint8_t * | end () |
| Mutable iterator to the end of the mask. | |
| ZIVID_UTILS_EXPORT uint8_t & | operator() (size_t idx) |
| Mutable reference to an element given by a 1D linear index. | |
| ZIVID_UTILS_EXPORT uint8_t & | operator() (size_t i, size_t j) |
| Mutable reference to an element given by row and column. | |
| ZIVID_UTILS_EXPORT const uint8_t & | operator() (size_t idx) const |
| Const reference to an element given by a 1D linear index. | |
| ZIVID_UTILS_EXPORT const uint8_t & | operator() (size_t i, size_t j) const |
| Const reference to an element given by row and column. | |
| Public Member Functions inherited from Zivid::Array2D< uint8_t > | |
| Array2D () | |
| Create an empty Array2D. | |
| size_t | width () const |
| Get the width of the array (number of columns) | |
| size_t | height () const |
| Get the height of the array (number of rows) | |
| size_t | size () const |
| Get the number of elements in the array. | |
| bool | isEmpty () const |
| Check if the array is empty. | |
| const uint8_t * | data () const |
| Pointer to the first data element of the array. | |
| const uint8_t & | operator() (size_t idx) const |
| Constant reference to an element given by a 1D linear index. | |
| ConstIterator | begin () const |
| Iterator to the beginning of the array. | |
| ConstIterator | end () const |
| Iterator to the end of the array. | |
| ConstIterator | cbegin () const |
| Iterator to the beginning of the array. | |
| ConstIterator | cend () const |
| Iterator to the end of the array. | |
| std::string | toString () const |
| Get array information as string. | |
Additional Inherited Members | |
| Public Types inherited from Zivid::Array2D< uint8_t > | |
| using | ValueType |
| The type of the elements stored in the Array2D. | |
| using | ConstIterator |
| The iterator type for immutable access. It iterates over individual Array2D elements in row major order. | |
A mask for filtering point cloud data.
The Mask class represents a 2D binary mask that can be used to filter point cloud data. Zero values in the mask indicate that the corresponding point should be preserved, while non-zero values indicate that the point should be masked out (set to NaN).
| ZIVID_UTILS_EXPORT Zivid::Mask::Mask | ( | ) |
Create an empty mask.
|
explicit |
Create a nonzero-filled mask with the specified resolution.
| resolution | The resolution (width x height) of the mask |
| ZIVID_UTILS_EXPORT Zivid::Mask::Mask | ( | const Resolution & | resolution, |
| const uint8_t * | beginIt, | ||
| const uint8_t * | endIt ) |
Create a mask from third-party mask data (e.g., OpenCV Mat)
| resolution | The resolution (width x height) of the mask |
| beginIt | Pointer to the beginning of mask data (uint8_t array) |
| endIt | Pointer to the end of mask data (uint8_t array) |
The data is copied, so the original data can be safely freed after construction.
|
inline |
Create a mask from iterator range.
| resolution | The resolution (width x height) of the mask |
| beginIt | Iterator to the beginning of mask data |
| endIt | Iterator to the end of mask data |
|
inline |
Mutable iterator to the beginning of the mask.
Returns an iterator to the first element of the mask
|
inline |
Mutable pointer to the first data element of the mask.
If the mask is empty then this method returns nullptr
|
inline |
Const pointer to the first data element of the mask.
If the mask is empty then this method returns nullptr
|
inline |
Mutable iterator to the end of the mask.
Returns an iterator to one past the last element of the mask
|
inline |
Mutable reference to an element given by row and column.
Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the mask is empty causes undefined behavior.
|
inline |
Const reference to an element given by row and column.
Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the mask is empty causes undefined behavior.
|
inline |
Mutable reference to an element given by a 1D linear index.
Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the mask is empty causes undefined behavior.
| idx | Index (from 0 to size - 1) |
|
inline |
Const reference to an element given by a 1D linear index.
Data is stored in row-major order. No bounds checking is performed. Calling this operator with an argument that is out of range causes undefined behavior. Calling this operator when the mask is empty causes undefined behavior.
| idx | Index (from 0 to size - 1) |
| ZIVID_UTILS_EXPORT Resolution Zivid::Mask::resolution | ( | ) | const |
Get the resolution of the mask.
| ZIVID_UTILS_EXPORT std::string Zivid::Mask::toString | ( | ) | const |
Get string representation of the mask.