GMLImage
@interface GMLImage : NSObject用於裝置端機器學習的圖片。
-
圖片寬度 (以像素為單位)。
聲明
Objective-C
@property (nonatomic, readonly) CGFloat width; -
圖片的高度 (以像素為單位)。
聲明
Objective-C
@property (nonatomic, readonly) CGFloat height; -
圖片的顯示方向。如果
imageSourceType為.image,則預設值為.imageimage.imageOrientation;否則預設值為.up。聲明
Objective-C
@property (nonatomic) int orientation; -
圖片來源的類型。
聲明
Objective-C
@property (nonatomic, readonly) GMLImageSourceType imageSourceType; -
來源圖片。如果
imageSourceType不是.image,則為nil。聲明
Objective-C
@property (nonatomic, readonly, nullable) int *image; -
來源像素緩衝區。如果
imageSourceType不是.pixelBuffer,則為nil。聲明
Objective-C
@property (nonatomic, readonly, nullable) CVPixelBufferRef pixelBuffer; -
來源範例緩衝區。如果
imageSourceType不是.sampleBuffer,則為nil。聲明
Objective-C
@property (nonatomic, readonly, nullable) CMSampleBufferRef sampleBuffer; -
使用指定圖片初始化
MLImage物件。聲明
Objective-C
- (nullable instancetype)initWithImage:(id)image;參數
image要當做來源的圖片。其
CGImage屬性不得為NULL。傳回值
以指定映像檔做為來源的新
MLImage例項。nil(如果指定的image)nil或無效值。 -
使用指定的像素緩衝區初始化
MLImage物件。聲明
Objective-C
- (nullable instancetype)initWithPixelBuffer: (nonnull CVPixelBufferRef)pixelBuffer;參數
pixelBuffer要做為來源的像素緩衝區。新應用程式將由新的 生命週期內的
MLImage執行個體。傳回值
新的
MLImage例項,以指定像素緩衝區做為來源。nil表示 像素緩衝區為nil或無效。 -
使用指定的範例緩衝區初始化
MLImage物件。聲明
Objective-C
- (nullable instancetype)initWithSampleBuffer: (nonnull CMSampleBufferRef)sampleBuffer;參數
sampleBuffer要做為來源的範例緩衝區。新應用程式將由新的 生命週期內的
MLImage執行個體。樣本緩衝區必須以 像素緩衝區 (非壓縮資料)。實務上,應使用攝影機的視訊輸出內容。 就必須用於 iOS 裝置,而非其他任意類型的CMSampleBuffer。傳回值
以指定範例緩衝區做為來源的新
MLImage例項。nil表示 樣本緩衝區為nil或無效。 -
無法使用。
聲明
Objective-C
- (nonnull instancetype)init;