Skip to content

Commit a4ee0d8

Browse files
committed
make structures public
1 parent e3911ca commit a4ee0d8

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

Sources/FaceLiveness/FaceDetection/BlazeFace/DetectedFace.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ public struct DetectedFace {
2020

2121
let confidence: Float
2222

23-
func boundingBoxFromLandmarks(ovalRect: CGRect,
24-
ovalMatchChallenge: FaceLivenessSession.OvalMatchChallenge) -> CGRect {
23+
@_spi(PredictionsFaceLiveness)
24+
public func boundingBoxFromLandmarks(
25+
ovalRect: CGRect,
26+
ovalMatchChallenge: FaceLivenessSession.OvalMatchChallenge
27+
) -> CGRect {
2528
let alpha = 2.0
2629
let gamma = 1.8
2730
let ow = (alpha * pupilDistance + gamma * faceHeight) / 2

Sources/FaceLiveness/FaceDetection/BlazeFace/FaceDetectorShortRange+Model.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public extension FaceDetectorShortRange {
4141
self.detectionResultHandler = detectionResultHandler
4242
}
4343

44-
func setFaceDetectionSessionConfigurationWrapper(configuration: FaceDetectionSessionConfigurationWrapper) {
44+
@_spi(PredictionsFaceLiveness)
45+
public func setFaceDetectionSessionConfigurationWrapper(configuration: FaceDetectionSessionConfigurationWrapper) {
4546
self.faceDetectionSessionConfiguration = configuration
4647
}
4748

Sources/FaceLiveness/FaceDetection/FaceDetector.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ public protocol FaceDetector {
1313
func setResultHandler(detectionResultHandler: FaceDetectionResultHandler)
1414
}
1515

16-
public protocol FaceDetectionResultHandler: AnyObject {
16+
public protocol FaceDetectionResultHandler: AnyObject {
1717
func process(newResult: FaceDetectionResult)
1818
}
1919

20+
@_spi(PredictionsFaceLiveness)
2021
public protocol FaceDetectionSessionConfigurationWrapper: AnyObject {
2122
var sessionConfiguration: FaceLivenessSession.SessionConfiguration? { get }
2223
}

Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionView.swift

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ public enum LivenessCamera {
353353
}
354354

355355
public struct ChallengeOptions {
356-
let faceMovementChallengeOption: FaceMovementChallengeOption
357-
let faceMovementAndLightChallengeOption: FaceMovementAndLightChallengeOption
358-
356+
public let faceMovementChallengeOption: FaceMovementChallengeOption
357+
public let faceMovementAndLightChallengeOption: FaceMovementAndLightChallengeOption
358+
359359
public init(faceMovementChallengeOption: FaceMovementChallengeOption = .init(camera: .front),
360360
faceMovementAndLightChallengeOption: FaceMovementAndLightChallengeOption = .init()) {
361361
self.faceMovementChallengeOption = faceMovementChallengeOption
@@ -364,19 +364,25 @@ public struct ChallengeOptions {
364364
}
365365

366366
public struct FaceMovementChallengeOption {
367-
let challenge: Challenge
368-
let camera: LivenessCamera
369-
367+
@_spi(PredictionsFaceLiveness)
368+
public let challenge: Challenge
369+
370+
@_spi(PredictionsFaceLiveness)
371+
public let camera: LivenessCamera
372+
370373
public init(camera: LivenessCamera) {
371374
self.challenge = .faceMovementChallenge("1.0.0")
372375
self.camera = camera
373376
}
374377
}
375378

376379
public struct FaceMovementAndLightChallengeOption {
377-
let challenge: Challenge
378-
let camera: LivenessCamera
379-
380+
@_spi(PredictionsFaceLiveness)
381+
public let challenge: Challenge
382+
383+
@_spi(PredictionsFaceLiveness)
384+
public let camera: LivenessCamera
385+
380386
public init() {
381387
self.challenge = .faceMovementAndLightChallenge("2.0.0")
382388
self.camera = .front

Sources/FaceLiveness/Views/Liveness/LivenessStateMachine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public struct LivenessStateMachine {
7979
state = .completedDisplayingFreshness
8080
}
8181

82-
mutating func completedNoLightCheck() {
82+
public mutating func completedNoLightCheck() {
8383
state = .completedNoLightCheck
8484
}
8585

0 commit comments

Comments
 (0)