2023-09-26 03:39:17 -06:00
|
|
|
|
import { Orientation } from './Orientation'
|
|
|
|
|
import type { TemporaryFile } from './TemporaryFile'
|
2021-02-19 08:07:53 -07:00
|
|
|
|
|
|
|
|
|
export interface TakePhotoOptions {
|
|
|
|
|
/**
|
|
|
|
|
* Indicates how photo quality should be prioritized against speed.
|
|
|
|
|
*
|
2021-09-24 02:15:26 -06:00
|
|
|
|
* * `"quality"` Indicates that photo quality is paramount, even at the expense of shot-to-shot time
|
2021-02-19 08:07:53 -07:00
|
|
|
|
* * `"balanced"` Indicates that photo quality and speed of delivery are balanced in priority
|
2021-09-24 02:15:26 -06:00
|
|
|
|
* * `"speed"` Indicates that speed of photo delivery is most important, even at the expense of quality
|
2021-02-19 08:07:53 -07:00
|
|
|
|
*
|
|
|
|
|
* @default "balanced"
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
qualityPrioritization?: 'quality' | 'balanced' | 'speed'
|
2021-02-19 08:07:53 -07:00
|
|
|
|
/**
|
|
|
|
|
* Whether the Flash should be enabled or disabled
|
|
|
|
|
*
|
|
|
|
|
* @default "auto"
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
flash?: 'on' | 'off' | 'auto'
|
2021-02-19 08:07:53 -07:00
|
|
|
|
/**
|
|
|
|
|
* Specifies whether red-eye reduction should be applied automatically on flash captures.
|
|
|
|
|
*
|
|
|
|
|
* @default false
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
enableAutoRedEyeReduction?: boolean
|
2021-02-19 08:07:53 -07:00
|
|
|
|
/**
|
2023-09-25 04:57:03 -06:00
|
|
|
|
* Indicates whether still image stabilization will be enabled when capturing the photo
|
2021-02-19 08:07:53 -07:00
|
|
|
|
*
|
|
|
|
|
* @default false
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
enableAutoStabilization?: boolean
|
2021-02-19 08:07:53 -07:00
|
|
|
|
/**
|
2023-08-21 04:50:14 -06:00
|
|
|
|
* Specifies whether the photo output should use content aware distortion correction on this photo request.
|
|
|
|
|
* For example, the algorithm may not apply correction to faces in the center of a photo, but may apply it to faces near the photo’s edges.
|
2021-02-19 08:07:53 -07:00
|
|
|
|
*
|
2023-08-21 04:50:14 -06:00
|
|
|
|
* @platform iOS
|
2021-02-19 08:07:53 -07:00
|
|
|
|
* @default false
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
enableAutoDistortionCorrection?: boolean
|
2023-08-21 07:27:42 -06:00
|
|
|
|
/**
|
|
|
|
|
* Whether to play the default shutter "click" sound when taking a picture or not.
|
|
|
|
|
*
|
|
|
|
|
* @default true
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
enableShutterSound?: boolean
|
2021-02-19 08:07:53 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Represents a Photo taken by the Camera written to the local filesystem.
|
2021-03-08 10:21:30 -07:00
|
|
|
|
*
|
2023-08-21 04:50:14 -06:00
|
|
|
|
* See {@linkcode Camera.takePhoto | Camera.takePhoto()}
|
2021-02-19 08:07:53 -07:00
|
|
|
|
*/
|
2021-03-08 09:51:47 -07:00
|
|
|
|
export interface PhotoFile extends TemporaryFile {
|
2023-08-21 04:50:14 -06:00
|
|
|
|
/**
|
|
|
|
|
* The width of the photo, in pixels.
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
width: number
|
2023-08-21 04:50:14 -06:00
|
|
|
|
/**
|
|
|
|
|
* The height of the photo, in pixels.
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
height: number
|
2023-08-21 04:50:14 -06:00
|
|
|
|
/**
|
|
|
|
|
* Whether this photo is in RAW format or not.
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
isRawPhoto: boolean
|
2023-08-21 04:50:14 -06:00
|
|
|
|
/**
|
|
|
|
|
* Display orientation of the photo, relative to the Camera's sensor orientation.
|
|
|
|
|
*
|
|
|
|
|
* Note that Camera sensors are landscape, so e.g. "portrait" photos will have a value of "landscape-left", etc.
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
orientation: Orientation
|
2023-08-21 04:50:14 -06:00
|
|
|
|
/**
|
|
|
|
|
* Whether this photo is mirrored (selfies) or not.
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
isMirrored: boolean
|
|
|
|
|
thumbnail?: Record<string, unknown>
|
2021-03-09 04:02:10 -07:00
|
|
|
|
/**
|
2023-08-21 06:24:06 -06:00
|
|
|
|
* Metadata information describing the captured image. (iOS only)
|
2021-03-09 04:02:10 -07:00
|
|
|
|
*
|
|
|
|
|
* @see [AVCapturePhoto.metadata](https://developer.apple.com/documentation/avfoundation/avcapturephoto/2873982-metadata)
|
2023-08-21 06:24:06 -06:00
|
|
|
|
*
|
|
|
|
|
* @platform iOS
|
2021-03-09 04:02:10 -07:00
|
|
|
|
*/
|
2023-08-21 04:50:14 -06:00
|
|
|
|
metadata?: {
|
|
|
|
|
/**
|
|
|
|
|
* Orientation of the EXIF Image.
|
|
|
|
|
*
|
|
|
|
|
* * 1 = 0 degrees: the correct orientation, no adjustment is required.
|
|
|
|
|
* * 2 = 0 degrees, mirrored: image has been flipped back-to-front.
|
|
|
|
|
* * 3 = 180 degrees: image is upside down.
|
|
|
|
|
* * 4 = 180 degrees, mirrored: image has been flipped back-to-front and is upside down.
|
|
|
|
|
* * 5 = 90 degrees: image has been flipped back-to-front and is on its side.
|
|
|
|
|
* * 6 = 90 degrees, mirrored: image is on its side.
|
|
|
|
|
* * 7 = 270 degrees: image has been flipped back-to-front and is on its far side.
|
|
|
|
|
* * 8 = 270 degrees, mirrored: image is on its far side.
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
Orientation: number
|
2021-03-08 09:51:47 -07:00
|
|
|
|
/**
|
|
|
|
|
* @platform iOS
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
DPIHeight: number
|
2021-03-08 09:51:47 -07:00
|
|
|
|
/**
|
|
|
|
|
* @platform iOS
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
DPIWidth: number
|
2021-03-08 09:51:47 -07:00
|
|
|
|
/**
|
|
|
|
|
* Represents any data Apple cameras write to the metadata
|
|
|
|
|
*
|
|
|
|
|
* @platform iOS
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
'{MakerApple}'?: Record<string, unknown>
|
2021-03-08 09:51:47 -07:00
|
|
|
|
'{TIFF}': {
|
2023-09-26 03:39:17 -06:00
|
|
|
|
ResolutionUnit: number
|
|
|
|
|
Software: string
|
|
|
|
|
Make: string
|
|
|
|
|
DateTime: string
|
|
|
|
|
XResolution: number
|
2021-02-19 08:07:53 -07:00
|
|
|
|
/**
|
|
|
|
|
* @platform iOS
|
|
|
|
|
*/
|
2023-09-26 03:39:17 -06:00
|
|
|
|
HostComputer?: string
|
|
|
|
|
Model: string
|
|
|
|
|
YResolution: number
|
|
|
|
|
}
|
2021-03-08 09:51:47 -07:00
|
|
|
|
'{Exif}': {
|
2023-09-26 03:39:17 -06:00
|
|
|
|
DateTimeOriginal: string
|
|
|
|
|
ExposureTime: number
|
|
|
|
|
FNumber: number
|
|
|
|
|
LensSpecification: number[]
|
|
|
|
|
ExposureBiasValue: number
|
|
|
|
|
ColorSpace: number
|
|
|
|
|
FocalLenIn35mmFilm: number
|
|
|
|
|
BrightnessValue: number
|
|
|
|
|
ExposureMode: number
|
|
|
|
|
LensModel: string
|
|
|
|
|
SceneType: number
|
|
|
|
|
PixelXDimension: number
|
|
|
|
|
ShutterSpeedValue: number
|
|
|
|
|
SensingMethod: number
|
|
|
|
|
SubjectArea: number[]
|
|
|
|
|
ApertureValue: number
|
|
|
|
|
SubsecTimeDigitized: string
|
|
|
|
|
FocalLength: number
|
|
|
|
|
LensMake: string
|
|
|
|
|
SubsecTimeOriginal: string
|
|
|
|
|
OffsetTimeDigitized: string
|
|
|
|
|
PixelYDimension: number
|
|
|
|
|
ISOSpeedRatings: number[]
|
|
|
|
|
WhiteBalance: number
|
|
|
|
|
DateTimeDigitized: string
|
|
|
|
|
OffsetTimeOriginal: string
|
|
|
|
|
ExifVersion: string
|
|
|
|
|
OffsetTime: string
|
|
|
|
|
Flash: number
|
|
|
|
|
ExposureProgram: number
|
|
|
|
|
MeteringMode: number
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-03-08 09:51:47 -07:00
|
|
|
|
}
|