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 33 package com.android.camera.one.v2.camera2proxy; 34 35 import android.hardware.camera2.CaptureResult; 36 import android.hardware.camera2.TotalCaptureResult; 37 38 import java.util.ArrayList; 39 import java.util.List; 40 41 import javax.annotation.Nonnull; 42 import javax.annotation.ParametersAreNonnullByDefault; 43 44 /** 45 * Wraps {@link TotalCaptureResult} 46 */ 47 @ParametersAreNonnullByDefault 48 public final class AndroidTotalCaptureResultProxy extends AndroidCaptureResultProxy implements 49 TotalCaptureResultProxy { 50 final TotalCaptureResult mTotalCaptureResult; 51 AndroidTotalCaptureResultProxy(TotalCaptureResult totalCaptureResult)52 public AndroidTotalCaptureResultProxy(TotalCaptureResult totalCaptureResult) { 53 super(totalCaptureResult); 54 mTotalCaptureResult = totalCaptureResult; 55 } 56 57 @Nonnull getPartialResults()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