CameraProperties.h 2.98 KB
Newer Older
jzhang's avatar
jzhang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

@import AVFoundation;
@import Foundation;

NS_ASSUME_NONNULL_BEGIN

#pragma mark - flash mode

/**
 * Represents camera's flash mode. Mirrors `FlashMode` enum in flash_mode.dart.
 */
typedef NS_ENUM(NSInteger, FLTFlashMode) {
  FLTFlashModeOff,
  FLTFlashModeAuto,
  FLTFlashModeAlways,
  FLTFlashModeTorch,
};

/**
 * Gets FLTFlashMode from its string representation.
 * @param mode a string representation of the FLTFlashMode.
 */
extern FLTFlashMode FLTGetFLTFlashModeForString(NSString *mode);

/**
 * Gets AVCaptureFlashMode from FLTFlashMode.
 * @param mode flash mode.
 */
extern AVCaptureFlashMode FLTGetAVCaptureFlashModeForFLTFlashMode(FLTFlashMode mode);

#pragma mark - exposure mode

/**
 * Represents camera's exposure mode. Mirrors ExposureMode in camera.dart.
 */
typedef NS_ENUM(NSInteger, FLTExposureMode) {
  FLTExposureModeAuto,
  FLTExposureModeLocked,
};

/**
 * Gets a string representation of exposure mode.
 * @param mode exposure mode
 */
extern NSString *FLTGetStringForFLTExposureMode(FLTExposureMode mode);

/**
 * Gets FLTExposureMode from its string representation.
 * @param mode a string representation of the FLTExposureMode.
 */
extern FLTExposureMode FLTGetFLTExposureModeForString(NSString *mode);

#pragma mark - focus mode

/**
 * Represents camera's focus mode. Mirrors FocusMode in camera.dart.
 */
typedef NS_ENUM(NSInteger, FLTFocusMode) {
  FLTFocusModeAuto,
  FLTFocusModeLocked,
};

/**
 * Gets a string representation from FLTFocusMode.
 * @param mode focus mode
 */
extern NSString *FLTGetStringForFLTFocusMode(FLTFocusMode mode);

/**
 * Gets FLTFocusMode from its string representation.
 * @param mode a string representation of focus mode.
 */
extern FLTFocusMode FLTGetFLTFocusModeForString(NSString *mode);

#pragma mark - device orientation

/**
 * Gets UIDeviceOrientation from its string representation.
 */
extern UIDeviceOrientation FLTGetUIDeviceOrientationForString(NSString *orientation);

/**
 * Gets a string representation of UIDeviceOrientation.
 */
extern NSString *FLTGetStringForUIDeviceOrientation(UIDeviceOrientation orientation);

#pragma mark - resolution preset

/**
 * Represents camera's resolution present. Mirrors ResolutionPreset in camera.dart.
 */
typedef NS_ENUM(NSInteger, FLTResolutionPreset) {
  FLTResolutionPresetVeryLow,
  FLTResolutionPresetLow,
  FLTResolutionPresetMedium,
  FLTResolutionPresetHigh,
  FLTResolutionPresetVeryHigh,
  FLTResolutionPresetUltraHigh,
  FLTResolutionPresetMax,
};

/**
 * Gets FLTResolutionPreset from its string representation.
 * @param preset a string representation of FLTResolutionPreset.
 */
extern FLTResolutionPreset FLTGetFLTResolutionPresetForString(NSString *preset);

#pragma mark - video format

/**
 * Gets VideoFormat from its string representation.
 */
extern OSType FLTGetVideoFormatFromString(NSString *videoFormatString);

NS_ASSUME_NONNULL_END