`android.hardware.camera2.params` 是 Android Camera2 API 中用于封装相机参数配置的包
android.hardware.camera2.params是 Android Camera2 API 中用于封装相机参数配置的包主要包含与相机捕获请求CaptureRequest和输出结果CaptureResult相关的参数类。这些类定义了各种可配置的相机控制参数如曝光、对焦、白平衡、闪光灯、色彩效果等供开发者在 Kotlin 或 Java 中使用。核心类包括Kotlin/Java 通用CaptureRequest.KeyT泛型键类用于安全地访问CaptureRequest和CaptureResult中的参数字段如CaptureRequest.CONTROL_MODE,CaptureRequest.SENSOR_EXPOSURE_TIME。CaptureResult.KeyT同上用于从CaptureResult中读取只读参数。MeteringRectangle表示测光/对焦区域矩形坐标 权重。OutputConfigurationAPI 26用于配置ImageReader或Surface的输出格式、尺寸和数据空间如 HDR、广色域。InputConfigurationAPI 28用于输入流如 reprocessing 场景。StreamConfigurationMap描述设备支持的输出 Surface 类型如ImageFormat.JPEG,YUV_420_888、尺寸、帧率范围等通过CameraCharacteristics获取。VendorTagDescriptor/VendorTagSection支持厂商自定义参数需设备厂商提供支持。✅ Kotlin 示例设置自动曝光和连续对焦valcaptureRequestBuildercameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW)captureRequestBuilder.set(CaptureRequest.CONTROL_MODE,CameraMetadata.CONTROL_MODE_AUTO)captureRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE,CameraMetadata.CONTROL_AF_MODE_CONTINUOUS_PICTURE)captureRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,CameraMetadata.CONTROL_AE_MODE_ON)// ... 设置 SurfacecameraDevice.createCaptureSession(listOf(surface),sessionCallback,null)✅ Java 示例获取支持的 AE 闭合时间val characteristicscameraManager.getCameraCharacteristics(cameraId)val mapcharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)val availableExposureTimescharacteristics.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE)⚠️ 注意事项所有参数必须通过CaptureRequest.Builder设置并提交到CaptureSession非所有设备都支持全部参数需通过CameraCharacteristics查询能力如REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSORKotlin 中建议使用androidx.camera.camera2封装库Jetpack CameraX以简化开发但底层仍依赖此包。android.hardware.camera2.params Kotlin |JavaClassesBlackLevelPattern Immutable class to store a 4-element vector of integers corresponding to a 2x2 pattern of color channel offsets used for the black level offsets of each color channel.Capability Immutable class to store the camera capability, its corresponding maximum streaming dimension and zoom range.ColorSpaceTransform Immutable class for describing a 3x3 matrix of Rational values in row-major order.Face Describes a face detected in an image.InputConfiguration Immutable class to store an input configuration that is used to create a reprocessable capture session.LensShadingMap Immutable class for describing a 4 x N x M lens shading map of floats.MandatoryStreamCombination Immutable class to store the available mandatory stream combination.MandatoryStreamCombination.MandatoryStreamInformation Immutable class to store available mandatory stream information.MeteringRectangle An immutable class to represent a rectangle (x, y, width, height) with an additional weight component.OisSample Immutable class to store an CaptureResult#STATISTICS_OIS_SAMPLES.OutputConfiguration A class for describing camera output, which contains a Surface and its specific configuration for creating capture session.RecommendedStreamConfigurationMap Immutable class to store the recommended stream configurations to set up Surfaces for creating a capture session with CameraDevice.createCaptureSession(SessionConfiguration).RggbChannelVector Immutable class to store a 4-element vector of floats indexable by a bayer RAW 2x2 pixel block.SessionConfiguration A helper class that aggregates all supported arguments for capture session initialization.StreamConfigurationMap Immutable class to store the available stream CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP to set up Surfaces for creating a capture session with CameraDevice.createCaptureSession(SessionConfiguration).TonemapCurve Immutable class for describing a 2 x M x 3 tonemap curve of floats.
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2481869.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!