public interface

CameraCaptureResult

 androidx.camera.core.CameraCaptureResult

Subclasses:

CameraCaptureResult.EmptyCameraCaptureResult

Overview

The result of a single image capture.

Summary

Methods
public CameraCaptureMetaData.AeStategetAeState()

Returns the current auto exposure state.

public CameraCaptureMetaData.AfModegetAfMode()

Returns the current auto focus mode of operation.

public CameraCaptureMetaData.AfStategetAfState()

Returns the current auto focus state.

public CameraCaptureMetaData.AwbStategetAwbState()

Returns the current auto white balance state.

public CameraCaptureMetaData.FlashStategetFlashState()

Returns the current flash state.

public java.lang.ObjectgetTag()

Returns the tag associated with the capture request.

public longgetTimestamp()

Returns the timestamp in nanoseconds.

Methods

public CameraCaptureMetaData.AfMode getAfMode()

Returns the current auto focus mode of operation.

public CameraCaptureMetaData.AfState getAfState()

Returns the current auto focus state.

public CameraCaptureMetaData.AeState getAeState()

Returns the current auto exposure state.

public CameraCaptureMetaData.AwbState getAwbState()

Returns the current auto white balance state.

public CameraCaptureMetaData.FlashState getFlashState()

Returns the current flash state.

public long getTimestamp()

Returns the timestamp in nanoseconds.

If the timestamp was unavailable then it will return -1L.

public java.lang.Object getTag()

Returns the tag associated with the capture request.

Source

/*
 * Copyright (C) 2019 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 androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;
import androidx.camera.core.CameraCaptureMetaData.AeState;
import androidx.camera.core.CameraCaptureMetaData.AfMode;
import androidx.camera.core.CameraCaptureMetaData.AfState;
import androidx.camera.core.CameraCaptureMetaData.AwbState;
import androidx.camera.core.CameraCaptureMetaData.FlashState;

/**
 * The result of a single image capture.
 *
 * @hide
 */
@RestrictTo(Scope.LIBRARY_GROUP)
public interface CameraCaptureResult {

    /** Returns the current auto focus mode of operation. */
    @NonNull
    AfMode getAfMode();

    /** Returns the current auto focus state. */
    @NonNull
    AfState getAfState();

    /** Returns the current auto exposure state. */
    @NonNull
    AeState getAeState();

    /** Returns the current auto white balance state.*/
    @NonNull
    AwbState getAwbState();

    /** Returns the current flash state. */
    @NonNull
    FlashState getFlashState();

    /**
     * Returns the timestamp in nanoseconds.
     *
     * <p> If the timestamp was unavailable then it will return {@code -1L}.
     */
    long getTimestamp();

    /** Returns the tag associated with the capture request. */
    Object getTag();

    /** An implementation of CameraCaptureResult which always return default results. */
    final class EmptyCameraCaptureResult implements CameraCaptureResult {

        public static CameraCaptureResult create() {
            return new EmptyCameraCaptureResult();
        }

        @NonNull
        @Override
        public AfMode getAfMode() {
            return AfMode.UNKNOWN;
        }

        @NonNull
        @Override
        public AfState getAfState() {
            return AfState.UNKNOWN;
        }

        @NonNull
        @Override
        public AeState getAeState() {
            return AeState.UNKNOWN;
        }

        @NonNull
        @Override
        public AwbState getAwbState() {
            return AwbState.UNKNOWN;
        }

        @NonNull
        @Override
        public FlashState getFlashState() {
            return FlashState.UNKNOWN;
        }

        @Override
        public long getTimestamp() {
            return -1L;
        }

        @Override
        public Object getTag() {
            return null;
        }
    }
}