1/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * Copyright (C) 2014 The Android Open Source Project
19 *
20 * Licensed under the Apache License, Version 2.0 (the "License");
21 * you may not use this file except in compliance with the License.
22 * You may obtain a copy of the License at
23 *
24 *      http://www.apache.org/licenses/LICENSE-2.0
25 *
26 * Unless required by applicable law or agreed to in writing, software
27 * distributed under the License is distributed on an "AS IS" BASIS,
28 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 * See the License for the specific language governing permissions and
30 * limitations under the License.
31 */
32
33package com.android.camera.one.v2.camera2proxy;
34
35import android.hardware.camera2.CaptureResult;
36import android.hardware.camera2.TotalCaptureResult;
37
38import java.util.ArrayList;
39import java.util.List;
40
41import javax.annotation.Nonnull;
42import javax.annotation.ParametersAreNonnullByDefault;
43
44/**
45 * Wraps {@link TotalCaptureResult}
46 */
47@ParametersAreNonnullByDefault
48public final class AndroidTotalCaptureResultProxy extends AndroidCaptureResultProxy implements
49        TotalCaptureResultProxy {
50    final TotalCaptureResult mTotalCaptureResult;
51
52    public AndroidTotalCaptureResultProxy(TotalCaptureResult totalCaptureResult) {
53        super(totalCaptureResult);
54        mTotalCaptureResult = totalCaptureResult;
55    }
56
57    @Nonnull
58    public List<CaptureResultProxy> getPartialResults() {
59        List<CaptureResult> partialResults = mTotalCaptureResult.getPartialResults();
60        ArrayList<CaptureResultProxy> proxies = new ArrayList<>(partialResults.size());
61        for (CaptureResult result : partialResults) {
62            proxies.add(new AndroidCaptureResultProxy(result));
63        }
64        return proxies;
65    }
66}
67