public final class ImageCaptureExtKt

Summary

Public methods

static final @NonNull ImageProxy

takePicture(
    @NonNull ImageCapture receiver,
    Function0<Unit> onCaptureStarted,
    Function1<@NonNull IntegerUnit> onCaptureProcessProgressed,
    Function1<@NonNull BitmapUnit> onPostviewBitmapAvailable
)

Captures a new still image for in memory access.

static final @NonNull ImageCapture.OutputFileResults

takePicture(
    @NonNull ImageCapture receiver,
    @NonNull ImageCapture.OutputFileOptions outputFileOptions,
    Function0<Unit> onCaptureStarted,
    Function1<@NonNull IntegerUnit> onCaptureProcessProgressed,
    Function1<@NonNull BitmapUnit> onPostviewBitmapAvailable
)

Captures a new still image and saves to a file along with application specified metadata.

Public methods

takePicture

public static final @NonNull ImageProxy takePicture(
    @NonNull ImageCapture receiver,
    Function0<Unit> onCaptureStarted,
    Function1<@NonNull IntegerUnit> onCaptureProcessProgressed,
    Function1<@NonNull BitmapUnit> onPostviewBitmapAvailable
)

Captures a new still image for in memory access.

The caller is responsible for calling ImageProxy.close on the returned image.

Parameters
Function0<Unit> onCaptureStarted

Callback for when the camera has started exposing the frame.

Function1<@NonNull IntegerUnit> onCaptureProcessProgressed

Callback to report the progress of the capture's processing.

Function1<@NonNull BitmapUnit> onPostviewBitmapAvailable

Callback to notify that the postview bitmap is available.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-05-15 UTC.