CvType

Objective-C

@interface CvType : NSObject

Swift

class CvType : NSObject

Utility functions for handling CvType values

Type Utility functions

  • Create CvType value from depth and channel values

    Declaration

    Objective-C

    + (int)makeType:(int)depth channels:(int)channels;

    Swift

    class func make(_ depth: Int32, channels: Int32) -> Int32

    Parameters

    depth

    Depth value. One of CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F or CV_64F

    channels

    Number of channels (from 1 to (CV_CN_MAX - 1))

  • Get number of channels for type

    Declaration

    Objective-C

    + (int)channels:(int)type;

    Swift

    class func channels(_ type: Int32) -> Int32

    Parameters

    type

    Type value

  • Get depth for type

    Declaration

    Objective-C

    + (int)depth:(int)type;

    Swift

    class func depth(_ type: Int32) -> Int32

    Parameters

    type

    Type value

  • Get raw type size in bytes for type

    Declaration

    Objective-C

    + (int)rawTypeSize:(int)type;

    Swift

    class func rawTypeSize(_ type: Int32) -> Int32

    Parameters

    type

    Type value

  • Returns true if the raw type is an integer type (if depth is CV_8U, CV_8S, CV_16U, CV_16S or CV_32S)

    Declaration

    Objective-C

    + (BOOL)isInteger:(int)type;

    Swift

    class func isInteger(_ type: Int32) -> Bool

    Parameters

    type

    Type value

  • Get element size in bytes for type

    Declaration

    Objective-C

    + (int)ELEM_SIZE:(int)type;

    Swift

    class func elemSize(_ type: Int32) -> Int32

    Parameters

    type

    Type value

  • Get the string name for type

    Declaration

    Objective-C

    + (nonnull NSString *)typeToString:(int)type;

    Swift

    class func type(toString type: Int32) -> String

    Parameters

    type

    Type value