RRHeadAugmentationAvatar

Deprecated

Objective-C


@interface RRHeadAugmentationAvatar : NSObject

Swift

class RRHeadAugmentationAvatar : NSObject

Special type of avatar which is created from a selfie/photo of the users face and a body template. This class can only be used together with the RRHeadAugmentationLayout. To use it with other layouts and functionality, call the bake method and proceede with the resulting RRAvatar.

  • Creates a RRHeadAugmentationAvatar from a file.

    Declaration

    Objective-C

    + (RRHeadAugmentationAvatar *_Nullable)headAugmentationAvatarFromFile:
        (NSString *_Nonnull)path;
  • Creates a RRHeadAugmentationAvatar from a buffer.

    Declaration

    Objective-C

    + (RRHeadAugmentationAvatar *_Nullable)headAugmentationAvatarFromBuffer:
        (NSData *_Nonnull)buffer;

    Swift

    /*not inherited*/ init?(fromBuffer buffer: Data)
  • Initialises the class from a buffer.

    Declaration

    Objective-C

    - (instancetype _Nullable)initFromByteBuffer:(nonnull NSData *)byteBuffer;

    Swift

    init?(fromByteBuffer byteBuffer: Data)
  • Initialises the class from file.

    Declaration

    Objective-C

    - (instancetype _Nullable)initFromFile:(nonnull NSString *)path;

    Swift

    init?(fromFile path: String)
  • Creates a RRAvatar based on the body template, the face image and the choosen parameters.

    Declaration

    Objective-C

    - (RRAvatar *_Nullable)bakeWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func bake() throws -> RRAvatar

    Parameters

    error

    An optional pointer to an NSError pointer. When this method fails, it will set an NSError instance to this pointer if provided.

    Return Value

    An RRAvatar instance ready for mix and match. This method returns nil if an error occurs.

  • Offset of the head along the y-axis in the range from -1 to 1. Use this property to change the length of the neck.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat verticalHeadOffset;

    Swift

    var verticalHeadOffset: CGFloat { get set }
  • Scale of the head in the range from -1 to 1.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat headScale;

    Swift

    var headScale: CGFloat { get set }
  • Brightness of the whole avatar in the range from -1 to 1.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat brightness;

    Swift

    var brightness: CGFloat { get set }
  • Contrast of the whole avatar in the range from -1 to 1.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat contrast;

    Swift

    var contrast: CGFloat { get set }
  • Intensity of the shadow under the chin in the range from 0 to 1.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat shadowIntensity;

    Swift

    var shadowIntensity: CGFloat { get set }
  • Hardness of the shadow under the chin in the range from 0 to 1.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat shadowHardness;

    Swift

    var shadowHardness: CGFloat { get set }
  • Color of the shadow under the chin.

    Declaration

    Objective-C

    @property (nonatomic, strong) UIColor *_Nonnull shadowColor;

    Swift

    var shadowColor: UIColor { get set }