Classes

The following classes are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface QEPixelBufferData : NSObject
    
    /****
     * The CVPixelBuffer that you want to process.
     */
    @property (nonatomic, assign) CVPixelBufferRef bufferIn;
    
    /****
     * The processed CVPixelBuffer will be placed here.
     */
    @property (nonatomic, assign) CVPixelBufferRef bufferOut;
    
    /****
     * Specifies the rotation angle of the bufferIn by which the face/body (if any) in the bufferIn needs to be rotated clockwise to the frontal face/body. Examples are 0/90/180/270, default is 0.
     * Note: Only takes effect if QueenEngineConfigInfo's member variable autoSettingImgAngle is set to NO.
     */
    @property (nonatomic, assign) size_t inputAngle;
    
    /****
     * Specifies the rotation angle by which the detected frontal face/body needs to be rotated counterclockwise. Examples are 0/90/180/270, default is 0.
     * Note: Only takes effect if QueenEngineConfigInfo's member variable autoSettingImgAngle is set to NO. In general, the value set should be consistent with the inputAngle, so that the coordinate position of the recognized face/human body result fits the original image.
     */
    @property (nonatomic, assign) size_t outputAngle;
    
    /****
     * The direction in which the detected face/body coordinates need to be flipped, the default value is kQueenBeautyFlipAxisNone.
     */
    @property (nonatomic, assign) kQueenBeautyFlipAxis outputFlipAxis;
    
    /****
     * The CMSampleBuffer that you want to process.
     */
    @property (nonatomic, assign) CMSampleBufferRef sampleBufferIn;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface QETextureData : NSObject
    
    /****
     * The OpenGL textureID that you want to process.
     */
    @property (nonatomic, assign) uint32_t inputTextureID;
    
    /****
     * The processed OpenGL textureID will be placed here.
     */
    @property (nonatomic, assign) uint32_t outputTextureID;
    
    /****
     * Texture width.
     */
    @property (nonatomic, assign) int width;
    
    /****
     * Texture height.
     */
    @property (nonatomic, assign) int height;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface QEGestureData : NSObject
    
    /****
     * Type of detected gesture.
     */
    @property (nonatomic, assign) kQueenStaticGestureType gesture;
    
    /****
     * Type of detected hand movements.
     */
    @property (nonatomic, assign) kQueenHandActionType action;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface QEFaceExpressionData : NSObject
    
    /****
     * Type of detected face expression.
     */
    @property (nonatomic, assign) kQueenFaceExpressionType expression;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface QEAutoFaceShapeData : NSObject
    
    /****
     * The face shaping status.
     */
    @property (nonatomic, assign) kQueenAutoFaceShapeStatus status;
    
    /****
     * Face Yaw.
     */
    @property (nonatomic, assign) float yaw;
    
    /****
     * Face Pitch.
     */
    @property (nonatomic, assign) float pitch;
    
    /****
     * Face Roll.
     */
    @property (nonatomic, assign) float roll;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface QueenEngine : NSObject
    
    /****
     * Specifies the delegate of QueenEngine.
     */
    @property (nonatomic, weak) id <QueenEngineDelegate> delegate;
    
    /****
     * Get version of the SDK.
     */
    + (NSString *)getVersion;
    
    /****
     * Initialize the engine.
     * @param configInfo The engine configuration information.
     */
    - (instancetype)initWithConfigInfo:(QueenEngineConfigInfo *)configInfo;
    
    /****
     * Update the engine configuration information.
     * Note: This method takes effect only when initWithConfigInfo with nil, and the non-null value can only be set once.
     * @param configInfo The engine configuration information.
     */
    - (void)updateConfigInfo:(QueenEngineConfigInfo *)configInfo;
    
    /****
     * Release the engine.
     * Note: Need to be called on the rendering thread.
     */
    - (void)destroyEngine;
    
    /****
     * Performance mode.
     * Note: After turning it on, the effect will be slightly worse.
     * @param enabled YES/NO, default is NO.
     */
    - (void)powerSavingEnabled:(BOOL)enabled;
    
    /****
     * Set the rendered viewport.
     * Note: If not set, the width and height of the input data are used by default.
     * @param originX Default is 0.
     * @param originY Default is 0.
     * @param width Default is 0.
     * @param height Default is 0.
     */
    - (void)setScreenViewportWithOriginX:(int)originX withOriginY:(int)originY withWidth:(int)width withHeight:(int)height;
    
    /****
     * Set the output clipping rectangle.
     * Note: If not set, the width and height of the input data are used by default.
     * @param originX Default is 0.
     * @param originY Default is 0.
     * @param width Default is 0.
     * @param height Default is 0.
     */
    - (void)setOutputRectWithOriginX:(int)originX withOriginY:(int)originY withWidth:(int)width withHeight:(int)height;
    
    /****
     * Enabled features.
     * @param type kQueenBeautyType.
     * @param enabled YES/NO.
     */
    - (void)setQueenBeautyType:(kQueenBeautyType)type enable:(BOOL)enabled;
    
    /****
     * Enabled features.
     * @param type kQueenBeautyType.
     * @param enabled YES/NO.
     * @param mode kQueenBeautyFilterMode.
     */
    - (void)setQueenBeautyType:(kQueenBeautyType)type enable:(BOOL)enabled mode:(kQueenBeautyFilterMode)mode;
    
    /****
     * Set value of a specified feature.
     * @param param kQueenBeautyParams.
     * @param value Refer to the description of kQueenBeautyParams.
     */
    - (void)setQueenBeautyParams:(kQueenBeautyParams)param value:(float)value;
    
    /****
     * Get value of a specified feature.
     * @param param kQueenBeautyParams
     */
    - (float)getQueenBeautyParams:(kQueenBeautyParams)param;
    
    /****
     * Set resource of filter.
     * Note: kQueenBeautyTypeLUT should be enabled before setting it.
     * @param imagePath Specifies the filter resource file path.
     */
    - (void)setLutImagePath:(NSString *)imagePath;
    
    /****
     * Set value of face shape.
     * Note: kQueenBeautyTypeFaceShape should be enabled before setting it.
     * @param faceShapeType kQueenBeautyFaceShapeType.
     * @param value Refer to the description of kQueenBeautyFaceShapeType.
     */
    - (void)setFaceShape:(kQueenBeautyFaceShapeType)faceShapeType value:(float)value;
    
    /****
     * Set value of body shape.
     * Note: kQueenBeautyTypeBodyShape should be enabled before setting it.
     * @param bodyShapeType kQueenBeautyBodyShapeType.
     * @param value Refer to the description of kQueenBeautyBodyShapeType.
     */
    - (void)setBodyShape:(kQueenBeautyBodyShapeType)bodyShapeType value:(float)value;
    
    /****
     * Set value of makeup.
     * Note: kQueenBeautyTypeMakeup should be enabled before setting it.
     * @param makeupType kQueenBeautyMakeupType.
     * @param imagePaths The resource file paths.
     * @param blend kQueenBeautyBlend.
     */
    - (void)setMakeupWithType:(kQueenBeautyMakeupType)makeupType paths:(NSArray<NSString *> *)imagePaths blendType:(kQueenBeautyBlend)blend;
    
    /****
     * Set value of makeup.
     * Note: kQueenBeautyTypeMakeup should be enabled before setting it.
     * @param makeupType kQueenBeautyMakeupType.
     * @param imagePaths The resource file paths.
     * @param blend kQueenBeautyBlend.
     * @param fps Specifies the fps of makeup resource.
     */
    - (void)setMakeupWithType:(kQueenBeautyMakeupType)makeupType paths:(NSArray<NSString *> *)imagePaths blendType:(kQueenBeautyBlend)blend fps:(int)fps;
    
    /****
     * Set alpha of makeup.
     * @param makeupType kQueenBeautyMakeupType.
     * @param isFeMale NO for male, YES for female, set YES here.
     * @param alpha Specifies the alpha of makeup.
     */
    - (void)setMakeupAlphaWithType:(kQueenBeautyMakeupType)makeupType female:(BOOL)isFeMale alpha:(float)alpha;
    
    /****
     * Set blend of makeup.
     * @param makeupType kQueenBeautyMakeupType.
     * @param blend kQueenBeautyBlend.
     */
    - (void)setMakeupBlendWithType:(kQueenBeautyMakeupType)makeupType blendType:(kQueenBeautyBlend)blend;
    
    /****
     * Clear all makeup effect.
     */
    - (void)resetAllMakeupType;
    
    /****
     * Set hair color.
     * Note: kQueenBeautyTypeHairColor should be enabled before setting it.
     * @param red [0,1]
     * @param green [0,1]
     * @param blue [0,1]
     */
    - (void)setHairColorWithRed:(float)red withGreen:(float)green withBlue:(float)blue;
    
    /****
     * Add sticker.
     * @param materialPath Specifies the sticker resource file path that should be added.
     */
    - (void)addMaterialWithPath:(NSString *)materialPath;
    
    /****
     * Remove sticker.
     * @param materialPath Specifies the sticker resource file path that should be removed.
     */
    - (void)removeMaterialWithPath:(NSString *)materialPath;
    
    /****
     * Green/Blue Screen matting.
     * Note: When this is turned on, the pure color background matting (setPureColorToBackground) will be disabled.
     * @param backgroundImagePath Specifies the background resource file path that needs to be replaced by green/blue screen. nil is disabled.
     * @param blueScreenEnabled Set if blue screen matting.
     * @param threshold Specifies the green/blue screen sensitivity, default is 1. Only takes effect when autoThresholdEnabled is NO.
     * @param autoThresholdEnabled Whether to dynamically calculate the screen sensitivity based on the environment.
     */
    - (void)setGreenScreen:(NSString *)backgroundImagePath blueScreenEnabled:(BOOL)blueScreenEnabled threshold:(float)threshold autoThresholdEnabled:(BOOL)autoThresholdEnabled;
    
    /****
     * Pure color Screen matting.
     * Note: When this is turned on, the pure color background matting (setGreenScreen) will be disabled.
     * @param backgroundImagePath Specifies the background resource file path that needs to be replaced by specifies color screen. nil is disabled.
     * @param colorType Specifies the color type that should be matted, 0green, 1blue, 2cyan, 3purple, 4yellow, 5red, default is 0.
     * @param threshold Specifies the closeness of color, [-1, 1], default is 0.
     */
    - (void)setPureColorToBackground:(NSString *)backgroundImagePath colorType:(kQueenBeautyBgColorType)colorType threshold:(float)threshold;
    
    /****
     * Choose process type for background segment.
     * @param backgroundProcessType kQueenBackgroundProcessType, default is kQueenBackgroundBlur.
     */
    - (void)setSegmentBackgroundProcessType:(kQueenBackgroundProcessType)backgroundProcessType;
    
    /****
     * Choose performance mode for background segment.
     * Note: Please call this method before using background segment function.
     * @param performanceMode kQueenSegmentPerformanceMode.
     */
    - (void)setSegmentPerformanceMode:(kQueenSegmentPerformanceMode)performanceMode;
    
    /****
     * Set the foreground margins of the background segment.
     * @param foregroundPadding The foreground margins, [0,15], default is 0.
     */
    - (void)setAISegmentForegroundPadding:(int)foregroundPadding;
    
    /****
     * AR writing/painting.
     * @param enabled YES/NO.
     * @param mode 1: write, 2: paint.
     */
    - (void)setARWriting:(BOOL)enabled mode:(int)mode;
    
    /****
     * If the detected face/body coordinates need to be flipped on the y-axis.
     * @param faceRenderFlipY Whether images that require key-positioned positions are rendered inverted, default is NO.
     * @param faceInfoFlipY Whether the keypoint data is flipped, default is NO.
     */
    - (void)setFaceRenderFlipY:(BOOL)faceRenderFlipY faceInfoFlipY:(BOOL)faceInfoFlipY;
    
    /****
     * Process QEPixelBufferData.
     * @param pixelBufferData Data should be processed.
     * @return kQueenResultCode.
     */
    - (kQueenResultCode)processPixelBuffer:(QEPixelBufferData *)pixelBufferData;
    
    /****
     * Process QETextureData.
     * @param textureData Data should be processed.
     * @return kQueenResultCode.
     */
    - (kQueenResultCode)processTexture:(QETextureData *)textureData;
    
    /****
     * For image data analysis.
     * Note: If processing textureData, this method should be called, otherwise this method should not be called.
     * @param imageData Specifies the image raw data.
     * @param format Specifies the color space.
     * @param width Specifies the image width.
     * @param height Specifies the image height.
     * @param stride Specifies the stride (in pixels) of the image, i.e. the number of bytes per line, default is 0.
     * @param intputAngle Specifies the rotation angle of the bufferIn by which the face/body (if any) in the bufferIn needs to be rotated clockwise to the frontal face/body. Examples are 0/90/180/270, default is 0.
     * Note: Only takes effect if QueenEngineConfigInfo's member variable autoSettingImgAngle is set to NO.
     * @param outputAngle Specifies the rotation angle by which the detected frontal face/body needs to be rotated counterclockwise. Examples are 0/90/180/270, default is 0.
     * Note: Only takes effect if QueenEngineConfigInfo's member variable autoSettingImgAngle is set to NO. In general, the value set should be consistent with the inputAngle, so that the coordinate position of the recognized face/human body result fits the original image.
     * @param flipAxis The direction in which the detected face/body coordinates need to be flipped, 0 do nothing,1 Flip on the x-axis, 2 Flip on the y-axis.
     */
    - (void)updateInputDataAndRunAlg:(uint8_t *)imageData withImgFormat:(kQueenImageFormat)format withWidth:(int)width withHeight:(int)height withStride:(int)stride
                      withInputAngle:(int)intputAngle withOutputAngle:(int)outputAngle withFlipAxis:(int)flipAxis;
    
    /****
     * Show key points for face.
     * @param show YES/NO.
     */
    - (void)showFaceDetectPoint:(BOOL)show;
    
    /****
     * Show key points for body.
     * @param show YES/NO.
     */
    - (void)showBodyDetectPoint:(BOOL)show;
    
    /****
     * Show key points for hand.
     * @param show YES/NO.
     */
    - (void)showHandDetectPoint:(BOOL)show;
    
    /****
     * Show lines for face.
     * @param show YES/NO.
     */
    - (void)showMakeupLine:(BOOL)show;
    
    /****
     * Show key points for ar writing/painting.
     * @param show YES/NO.
     */
    - (void)showARWritingDetectPoint:(BOOL)show;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface QueenEngineConfigInfo :NSObject
    
    /****
     * You can get a License Key after applying for authorization.
     */
    @property (nonatomic, copy) NSString *licenseKey;
    
    /****
     * Built-in certificate file path.
     */
    @property (nonatomic, copy) NSString *licenseFile;
    
    /****
     * The root directory of QueenEngine resource, default is nil, the main bundle path.
     */
    @property (nonatomic, copy) NSString *resRootPath;
    
    /****
     * Whether to automatically create GLContext by QueenEngine, if you want to process CVPixelBufferDataRef, you need to set it to YES, the default is YES.
     */
    @property (nonatomic, assign) BOOL withContext;
    
    /****
     * If you need to create a GLContext by QueenEngine synchronously when you create an engine, set it to YES, the default to NO.
     */
    @property (nonatomic, assign) BOOL createContextSync;
    
    /****
     * Whether to render to the screen, the default to NO.
     */
    @property (nonatomic, assign) BOOL toScreen;
    
    /****
     * Whether to set the inputAngle and outputAngle of the image automatically, the default is NO.
     */
    @property (nonatomic, assign) BOOL autoSettingImgAngle;
    
    /****
     * Whether to run in a custom thread, the default is YES.
     */
    @property (nonatomic, assign) BOOL runOnCustomThread;
    
    /****
     * Whether to allow data statistics , the default is YES.
     */
    @property (nonatomic, assign) BOOL enableStats;
    
    /****
     * Reserved field, optional.
     */
    @property (nonatomic, copy) NSString *extraInfo;
    
    @end