MatOfRect2i

Objective-C


@interface MatOfRect2i : Mat

Swift

class MatOfRect : Mat

Mat representation of an array of Rect objects

Constructors

  • Create MatOfRect from Mat object

    Declaration

    Objective-C

    - (nonnull instancetype)initWithMat:(nonnull Mat *)mat;

    Swift

    init(mat: Mat)

    Parameters

    mat

    Mat object from which to create MatOfRect

  • Create MatOfRect from array

    Declaration

    Objective-C

    - (nonnull instancetype)initWithArray:(nonnull NSArray<Rect2i *> *)array;

    Swift

    init(array: [Rect2i])

    Parameters

    array

    Array from which to create MatOfRect

Methods

  • Allocate specified number of elements

    Declaration

    Objective-C

    - (void)alloc:(int)elemNumber;

    Swift

    func alloc(_ elemNumber: Int32)

    Parameters

    elemNumber

    Number of elements

  • Populate Mat with elements of an array

    Declaration

    Objective-C

    - (void)fromArray:(nonnull NSArray<Rect2i *> *)array;

    Swift

    func fromArray(_ array: [Rect2i])

    Parameters

    array

    Array with which to populate the Mat

  • Output Mat elements as an array of Rect objects

    Declaration

    Objective-C

    - (nonnull NSArray<Rect2i *> *)toArray;

    Swift

    func toArray() -> [Rect2i]
  • Total number of values in Mat

    Declaration

    Objective-C

    - (int)length;

    Swift

    func length() -> Int32