1 /* 2 * Copyright 2021 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 package androidx.camera.extensions.internal.sessionprocessor; 18 19 import com.google.auto.value.AutoValue; 20 21 import org.jspecify.annotations.NonNull; 22 import org.jspecify.annotations.Nullable; 23 24 import java.util.List; 25 26 /** 27 * Surface will be created by constructing a MultiResolutionImageReader. 28 */ 29 @AutoValue 30 public abstract class MultiResolutionImageReaderOutputConfig implements Camera2OutputConfig { 31 /** 32 * Creates the {@link MultiResolutionImageReaderOutputConfig} instance. 33 */ create( int id, int surfaceGroupId, @Nullable String physicalCameraId, @NonNull List<Camera2OutputConfig> sharedOutputConfigs, int imageFormat, int maxImages)34 static MultiResolutionImageReaderOutputConfig create( 35 int id, int surfaceGroupId, @Nullable String physicalCameraId, 36 @NonNull List<Camera2OutputConfig> sharedOutputConfigs, 37 int imageFormat, int maxImages) { 38 return new AutoValue_MultiResolutionImageReaderOutputConfig(id, surfaceGroupId, 39 physicalCameraId, 40 sharedOutputConfigs, imageFormat, maxImages); 41 } 42 43 /** 44 * Gets the image format of the surface. 45 */ getImageFormat()46 abstract int getImageFormat(); 47 48 /** 49 * Gets the capacity for the image reader. 50 */ getMaxImages()51 abstract int getMaxImages(); 52 } 53