Mask
class Mask : NSObject, NSCopyingThe wrapper class for MediaPipe segmentation masks.
Masks are stored as UInt8 * or float * objects.
 Every mask has an underlying type which can be accessed using dataType. You can access the
 mask as any other type using the appropriate properties. For example, if the underlying type is
 uInt8, in addition to accessing the mask using uint8Data, you can access float32Data to get
 the 32 bit float data (with values ranging from 0.0 to 1.0). The first time you access the data
 as a type different from the underlying type, an expensive type conversion is performed.
 Subsequent accesses return a pointer to the memory location for the same type converted array. As
 type conversions can be expensive, it is recommended to limit the accesses to data of types
 different from the underlying type.
Masks that are returned from a MediaPipe Tasks are owned by by the underlying C++ Task. If you
 need to extend the lifetime of these objects, you can invoke the copy() method.
- 
                  
                  The width of the mask. DeclarationSwift var width: Int { get }
- 
                  
                  The height of the mask. DeclarationSwift var height: Int { get }
- 
                  
                  The data type of the mask. DeclarationSwift var dataType: MaskDataType { get }
- 
                  
                  The pointer to the memory location where the underlying mask as a single channel UInt8array is stored. Uint8 values use the full value range and range from 0 to 255.DeclarationSwift var uint8Data: UnsafePointer<UInt8> { get }
- 
                  
                  The pointer to the memory location where the underlying mask as a single channel float 32 array is stored. Float values range from 0.0 to 1.0. DeclarationSwift var float32Data: UnsafePointer<Float> { get }
- 
                  
                  Initializes an Maskobject of typeuInt8with the givenUInt8*data, width and height.If shouldCopyis set totrue, the newly createdMaskstores a reference to a deep copieduint8Data. Since deep copies are expensive, it is recommended to not setshouldCopyunless theMaskmust outlive the passed inuint8Data.DeclarationSwift init?(uInt8Data uint8Data: UnsafePointer<UInt8>, width: Int, height: Int, shouldCopy: Bool)Parametersuint8DataA pointer to the memory location of the UInt8data array.widthThe width of the mask. heightThe height of the mask. shouldCopyThe height of the mask. Return ValueA new Maskinstance with the givenUInt8*data, width and height.
- 
                  
                  Initializes an Maskobject of typefloat32with the givenfloat*data, width and height.If shouldCopyis set totrue, the newly createdMaskstores a reference to a deep copiedfloat32Data. Since deep copies are expensive, it is recommended to not setshouldCopyunless theMaskmust outlive the passed infloat32Data.DeclarationSwift init?(float32Data: UnsafePointer<Float>, width: Int, height: Int, shouldCopy: Bool)Parametersfloat32DataA pointer to the memory location of the floatdata array.widthThe width of the mask. heightThe height of the mask. Return ValueA new Maskinstance with the givenfloat*data, width and height.
- 
                  
                  Unavailable. 
- 
                  
                  Undocumented