public interface

ImageCaptureCapabilities

 androidx.camera.core.ImageCaptureCapabilities

Gradle dependencies

compile group: 'androidx.camera', name: 'camera-core', version: '1.5.0-alpha01'

  • groupId: androidx.camera
  • artifactId: camera-core
  • version: 1.5.0-alpha01

Artifact androidx.camera:camera-core:1.5.0-alpha01 it located at Google repository (https://maven.google.com/)

Overview

ImageCaptureCapabilities is used to query ImageCapture use case capabilities on the device.

Summary

Methods
public java.util.Set<java.lang.Integer>getSupportedOutputFormats()

Gets the supported ImageCapture.OutputFormat set.

public booleanisCaptureProcessProgressSupported()

Returns if the takePicture() call in ImageCapture is capable of notifying the ImageCapture.OnImageSavedCallback.onCaptureProcessProgressed(int) or ImageCapture.OnImageCapturedCallback.onCaptureProcessProgressed(int) callback to the apps.

public booleanisPostviewSupported()

Returns if the takePicture() call in ImageCapture is capable of outputting postview images.

Methods

public boolean isPostviewSupported()

Returns if the takePicture() call in ImageCapture is capable of outputting postview images.

A postview image is a low-quality image that's produced earlier during image capture than the final high-quality image, and can be used as a thumbnail or placeholder until the final image is ready. If supported, apps can enable the postview using ImageCapture.Builder.setPostviewEnabled(boolean).

public boolean isCaptureProcessProgressSupported()

Returns if the takePicture() call in ImageCapture is capable of notifying the ImageCapture.OnImageSavedCallback.onCaptureProcessProgressed(int) or ImageCapture.OnImageCapturedCallback.onCaptureProcessProgressed(int) callback to the apps.

public java.util.Set<java.lang.Integer> getSupportedOutputFormats()

Gets the supported ImageCapture.OutputFormat set.

The set returned will always contain ImageCapture.OUTPUT_FORMAT_JPEG format, support for other formats will vary by camera.

Returns:

a set of supported output formats.

See also: ImageCapture.Builder.setOutputFormat(int)

Source

/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.camera.core;

import androidx.annotation.NonNull;

import java.util.Set;

/**
 * ImageCaptureCapabilities is used to query {@link ImageCapture} use case capabilities on the
 * device.
 */
public interface ImageCaptureCapabilities {
    /**
     * Returns if the takePicture() call in {@link ImageCapture} is capable of outputting
     * postview images.
     *
     * <p>A postview image is a low-quality image that's produced earlier during image capture
     * than the final high-quality image, and can be used as a thumbnail or placeholder until the
     * final image is ready.
     *
     * If supported, apps can enable the postview using
     * {@link ImageCapture.Builder#setPostviewEnabled(boolean)}.
     */
    boolean isPostviewSupported();

    /**
     * Returns if the takePicture() call in {@link ImageCapture} is capable of notifying the
     * {@link ImageCapture.OnImageSavedCallback#onCaptureProcessProgressed(int)} or
     * {@link ImageCapture.OnImageCapturedCallback#onCaptureProcessProgressed(int)} callback to
     * the apps.
     */
    boolean isCaptureProcessProgressSupported();

    /**
     * Gets the supported {@link ImageCapture.OutputFormat} set.
     *
     * <p>The set returned will always contain {@link ImageCapture.OutputFormat#OUTPUT_FORMAT_JPEG}
     * format, support for other formats will vary by camera.
     *
     * @return a set of supported output formats.
     *
     * @see ImageCapture.Builder#setOutputFormat(int)
     */
    @ExperimentalImageCaptureOutputFormat
    @NonNull
    Set<@ImageCapture.OutputFormat Integer> getSupportedOutputFormats();
}