RRCapturePhotos

Objective-C

@interface RRCapturePhotos : NSObject

/// Count of all successful shots made during the capturing session
@property(nonatomic, readonly) NSInteger count;

/// Just flat collection of shots in `RRCapturePhoto` representation
@property(nonatomic, readonly) NSArray<RRCapturePhoto *> *photos;

/**
 Gets all captured data for every stage
 @return two dimensional collection (photos[stage][photo])
 */
- (NSArray<NSArray<NSData *> *> *)allPhotos;

/**
 Lazily fill stage with photos, managing avatar pose state
 @param photo object representing capture session photo entity
 @param poseState object representing current pose state for viewfinder
 @param stage number of current capturing stage
 */
- (void)appendPhoto:(RRCapturePhoto *)photo withPoseState:(RRPoseState)poseState toStage:(NSInteger)stage;

/**
 Clears stage photos data as well as its quality info and pose states
 @param stage number of current capturing stage
 */
- (void)clearStage:(NSInteger)stage;

/**
 Updates stage statistics on amount of skipped photos
 @param stage number of current capturing stage
 */
- (void)skipPhotoAtStage:(NSInteger)stage;

/**
 Updates counter if the user skipped quality warning
 @param stage number of current capturing stage
 */
- (void)skipQualityWarningForStage:(NSInteger)stage;

/**
 Return quality information about finished stages based on
 amount of correct `RRPoseState` and captured/skipped ratio
 @param stage number of current capturing stage
 @return quality value in range (0, 1)
 */
- (double)getStageQuality:(NSInteger)stage;

/**
Return overall quality estimate based on
amount of correct `RRPoseState` and captured/skipped ratio
@return quality value in range (0, 1)
*/
- (double)getOverallQuality;

/**
 Generates general information about all captured stages
 humans body `RRPoseState` at capture moment and on the photo itself
 @return collect all the info about photos for handy JSON serialization
 */
- (NSDictionary *)generateQualityInfo;

@end

Swift

class RRCapturePhotos : NSObject

Undocumented

  • Count of all successful shots made during the capturing session

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger count;

    Swift

    var count: Int { get }
  • Just flat collection of shots in RRCapturePhoto representation

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<RRCapturePhoto *> *photos;

    Swift

    var photos: [RRCapturePhoto]! { get }
  • Gets all captured data for every stage

    Declaration

    Objective-C

    - (NSArray<NSArray<NSData *> *> *)allPhotos;

    Swift

    func allPhotos() -> [[Data]]!

    Return Value

    two dimensional collection (photos[stage][photo])

  • Lazily fill stage with photos, managing avatar pose state

    Declaration

    Objective-C

    - (void)appendPhoto:(RRCapturePhoto *)photo
          withPoseState:(RRPoseState)poseState
                toStage:(NSInteger)stage;

    Swift

    func appendPhoto(_ photo: RRCapturePhoto!, with poseState: RRPoseState, toStage stage: Int)

    Parameters

    photo

    object representing capture session photo entity

    poseState

    object representing current pose state for viewfinder

    stage

    number of current capturing stage

  • Clears stage photos data as well as its quality info and pose states

    Declaration

    Objective-C

    - (void)clearStage:(NSInteger)stage;

    Swift

    func clearStage(_ stage: Int)

    Parameters

    stage

    number of current capturing stage

  • Updates stage statistics on amount of skipped photos

    Declaration

    Objective-C

    - (void)skipPhotoAtStage:(NSInteger)stage;

    Swift

    func skipPhoto(atStage stage: Int)

    Parameters

    stage

    number of current capturing stage

  • Updates counter if the user skipped quality warning

    Declaration

    Objective-C

    - (void)skipQualityWarningForStage:(NSInteger)stage;

    Swift

    func skipQualityWarning(forStage stage: Int)

    Parameters

    stage

    number of current capturing stage

  • Return quality information about finished stages based on amount of correct RRPoseState and captured/skipped ratio

    Declaration

    Objective-C

    - (double)getStageQuality:(NSInteger)stage;

    Swift

    func getStageQuality(_ stage: Int) -> Double

    Parameters

    stage

    number of current capturing stage

    Return Value

    quality value in range (0, 1)

  • Return overall quality estimate based on amount of correct RRPoseState and captured/skipped ratio

    Declaration

    Objective-C

    - (double)getOverallQuality;

    Swift

    func getOverallQuality() -> Double

    Return Value

    quality value in range (0, 1)

  • Generates general information about all captured stages humans body RRPoseState at capture moment and on the photo itself

    Declaration

    Objective-C

    - (NSDictionary *)generateQualityInfo;

    Swift

    func generateQualityInfo() -> [AnyHashable : Any]!

    Return Value

    collect all the info about photos for handy JSON serialization