Commit 939390e5 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Correctly annotate availability for shape detection, fix includes.

This is part of the work of cleaning out sdk_forward_declarations.

BUG=1044828

Change-Id: Ifc1affd27e949b4d46d94d10b001f6988df8b290
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019585
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735923}
parent 923c89c8
...@@ -39,92 +39,6 @@ BASE_EXPORT extern NSString* const CIDetectorTypeText; ...@@ -39,92 +39,6 @@ BASE_EXPORT extern NSString* const CIDetectorTypeText;
#endif // MAC_OS_X_VERSION_10_11 #endif // MAC_OS_X_VERSION_10_11
} // extern "C" } // extern "C"
// Once Chrome no longer supports OSX 10.12, everything within this
// preprocessor block can be removed.
#if !defined(MAC_OS_X_VERSION_10_13) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13
// VNRequest forward declarations.
@class VNRequest;
typedef void (^VNRequestCompletionHandler)(VNRequest* request, NSError* error);
@interface VNRequest : NSObject<NSCopying>
- (instancetype)initWithCompletionHandler:
(VNRequestCompletionHandler)completionHandler NS_DESIGNATED_INITIALIZER;
@property(readonly, nonatomic, copy) NSArray* results;
@end
// VNDetectFaceLandmarksRequest forward declarations.
@interface VNImageBasedRequest : VNRequest
@end
@protocol VNFaceObservationAccepting<NSObject>
@end
@interface VNDetectFaceLandmarksRequest
: VNImageBasedRequest<VNFaceObservationAccepting>
@end
// VNImageRequestHandler forward declarations.
typedef NSString* VNImageOption NS_STRING_ENUM;
@interface VNImageRequestHandler : NSObject
- (instancetype)initWithCIImage:(CIImage*)image
options:(NSDictionary<VNImageOption, id>*)options;
- (BOOL)performRequests:(NSArray<VNRequest*>*)requests error:(NSError**)error;
@end
// VNFaceLandmarks2D forward declarations.
@interface VNFaceLandmarkRegion : NSObject
@property(readonly) NSUInteger pointCount;
@end
@interface VNFaceLandmarkRegion2D : VNFaceLandmarkRegion
@property(readonly, assign)
const CGPoint* normalizedPoints NS_RETURNS_INNER_POINTER;
@end
@interface VNFaceLandmarks2D : NSObject
@property(readonly) VNFaceLandmarkRegion2D* leftEye;
@property(readonly) VNFaceLandmarkRegion2D* rightEye;
@property(readonly) VNFaceLandmarkRegion2D* outerLips;
@property(readonly) VNFaceLandmarkRegion2D* nose;
@end
// VNFaceObservation forward declarations.
@interface VNObservation : NSObject<NSCopying, NSSecureCoding>
@end
@interface VNDetectedObjectObservation : VNObservation
@property(readonly, nonatomic, assign) CGRect boundingBox;
@end
@interface VNFaceObservation : VNDetectedObjectObservation
@property(readonly, nonatomic, strong) VNFaceLandmarks2D* landmarks;
@end
// VNDetectBarcodesRequest forward declarations.
typedef NSString* VNBarcodeSymbology NS_STRING_ENUM;
@interface VNDetectBarcodesRequest : VNImageBasedRequest
@property(readwrite, nonatomic, copy) NSArray<VNBarcodeSymbology>* symbologies;
@end
// VNBarcodeObservation forward declarations.
@interface VNRectangleObservation : VNDetectedObjectObservation
@property(readonly, nonatomic, assign) CGPoint topLeft;
@property(readonly, nonatomic, assign) CGPoint topRight;
@property(readonly, nonatomic, assign) CGPoint bottomLeft;
@property(readonly, nonatomic, assign) CGPoint bottomRight;
@end
@interface VNBarcodeObservation : VNRectangleObservation
@property(readonly, nonatomic, copy) NSString* payloadStringValue;
@property(readonly, nonatomic, copy) VNBarcodeSymbology symbology;
@end
#endif // MAC_OS_X_VERSION_10_13
#if !defined(MAC_OS_X_VERSION_10_15) || \ #if !defined(MAC_OS_X_VERSION_10_15) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
......
...@@ -6,13 +6,14 @@ ...@@ -6,13 +6,14 @@
#define SERVICES_SHAPE_DETECTION_DETECTION_UTILS_MAC_H_ #define SERVICES_SHAPE_DETECTION_DETECTION_UTILS_MAC_H_
#import <CoreImage/CoreImage.h> #import <CoreImage/CoreImage.h>
#import <Foundation/Foundation.h>
#import <Vision/Vision.h>
#include <os/availability.h> #include <os/availability.h>
#include <memory> #include <memory>
#include "base/callback.h" #include "base/callback.h"
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#include "base/mac/sdk_forward_declarations.h"
#include "base/macros.h" #include "base/macros.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/rect_f.h" #include "ui/gfx/geometry/rect_f.h"
......
...@@ -15,9 +15,10 @@ namespace shape_detection { ...@@ -15,9 +15,10 @@ namespace shape_detection {
namespace { namespace {
mojom::LandmarkPtr BuildLandmark(VNFaceLandmarkRegion2D* landmark_region, mojom::LandmarkPtr API_AVAILABLE(macos(10.13))
mojom::LandmarkType landmark_type, BuildLandmark(VNFaceLandmarkRegion2D* landmark_region,
gfx::RectF bounding_box) { mojom::LandmarkType landmark_type,
gfx::RectF bounding_box) {
auto landmark = mojom::Landmark::New(); auto landmark = mojom::Landmark::New();
landmark->type = landmark_type; landmark->type = landmark_type;
landmark->locations.reserve(landmark_region.pointCount); landmark->locations.reserve(landmark_region.pointCount);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment