Photo
A photo captured in memory by CameraPhotoOutput.capturePhoto.
Save it with saveToFile or saveToTemporaryFile, or read its encoded bytes with getFileData (e.g. to decode it into an image to display). Convert it to a displayable Image with toImage, or use the platform-specific conversions: Photo.toBitmap() on Android and Photo.toUIImage() on iOS.
A Photo holds native memory: dispose it as soon as it is no longer needed. It implements AutoCloseable, so use { } disposes it automatically.
Properties
The CameraCalibrationData captured with this photo, if CapturePhotoSettings.enableCameraCalibrationDataDelivery was enabled and the device supports it. iOS only.
The PhotoContainerFormat of this photo.
The Depth data captured with this photo, if CapturePhotoSettings.enableDepthData was enabled and the device supports it. It is disposed together with this photo.
Whether this photo has a native pixel buffer, readable with getPixelBuffer.
Whether this photo is mirrored along its vertical axis.
Whether this photo is a RAW photo (no processing applied), or a processed one (e.g. JPEG).
The CameraOrientation this photo was captured in, applied lazily via EXIF or when converting it.
Functions
Gets the encoded file data of this photo, after processing and including EXIF metadata.
Gets a copy of this photo's pixels, without EXIF data.
Saves this photo in its containerFormat to the given path, a full filesystem path including the file name and extension. The parent directories must exist, and the file must not.
Saves this photo in its containerFormat to a temporary file, and returns its filesystem path.
Converts this photo to a decoded Image, with its orientation and mirroring applied. This runs synchronously, on the calling thread.
Same as toImage, but runs on a background dispatcher.
Converts this Photo to a UIImage, applying its Photo.orientation and Photo.isMirrored through the image's imageOrientation. Same as Photo.toImage followed by Image.toUIImage().