自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
高動態範圍模式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Camera2
API 提供各種高動態範圍 (HDR) 擷取功能。本頁面說明 HDR 的各種功能、能力和模式,以及這些項目因特定 API 而有所不同的情形。
HDR 靜態影像擷取
HDR 中的靜態影像擷取功能會囊括各種演算法,以改善行動裝置相機的動態範圍。
針對 Android 13 以上版本,10 位元相機輸出 capability
支援 10 位元相機輸出。HDR 動態範圍 DynamicRangeProfiles
類別可讓相機用戶端設定相機輸出內容,以便產生使用實際 10 位元像素格式和相應 10 位元轉移函式的影格。使用 HDR 動態範圍設定檔的 10 位元相機輸出設定只會啟用擴充的物理位元深度。10 位元相機輸出設定可搭配HDR 場景模式使用下列模式:
針對搭載 Android 12 以下版本的裝置,HDR 靜態影像擷取方法會處理某個時間點會壓縮至標準 8 位元動態範圍的影格。以下是 HDR 靜態影像拍攝方法,拍攝時會拍攝多張曝光值不同的影像,並透過融合個別影像產生最終 HDR 結果:
- HDR 場景模式:這個模式是在相機 HAL 層實作,如果相機客戶端支援,則可在一般相機擷取要求中設定。
- HDR 擴充類型:建議在高對比場景中使用這類擴充類型。使用擷取工作階段,但功能較一般擷取工作階段有限。在同一部裝置上,相機擴充功能產生的結果比一般擷取要求擁有更高的圖像品質。
HDR 錄影
與 HDR 靜態影像拍攝功能不同,HDR 影片僅指HDR 影片擷取 (10 位元影片錄製)。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[],[],null,["# High dynamic range modes\n\nVarious forms of high dynamic range (HDR) capture are available in the\n[`Camera2`](https://developer.android.com/reference/android/hardware/camera2/package-summary)\nAPI. This page describes the various features, capabilities, and modes for HDR\nand how they differ depending on the specific API.\n\nHDR still capture\n-----------------\n\nStill capture in HDR encapsulates a variety of algorithms for improving the\ndynamic range of mobile cameras.\n\nFor Android 13 and higher, the 10-bit camera output\n[`capability`](/docs/core/camera/10-bit-camera-output)\nsupports 10-bit camera output. The HDR dynamic range\n[`DynamicRangeProfiles`](https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles)\nclass lets camera clients configure camera outputs capable of producing\nframes with actual 10-bit pixel format and corresponding 10-bit transfer\nfunctions. 10-bit camera\n[output configurations](https://developer.android.com/reference/kotlin/android/hardware/camera2/params/OutputConfiguration#setdynamicrangeprofile)\nusing HDR dynamic range profiles enable only the extended physical bit depth.\n10-bit camera output configurations can use the following modes in conjunction\nwith the\n[HDR scene mode](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_SCENE_MODE_HDR):\n\n- 10-bit uncompressed still capture using the [P010](https://developer.android.com/reference/kotlin/android/graphics/ImageFormat#ycbcr_p010) pixel format.\n- HDR compressed still capture using the [`JPEG_R`](https://developer.android.com/reference/kotlin/android/graphics/ImageFormat#jpeg_r) pixel format based on the [Ultra HDR](https://developer.android.com/guide/topics/media/hdr-image-format) specification.\n\nFor devices running Android 12 or lower, HDR still capture methods involve\nprocessing frames that at some point get compressed to the standard 8-bit\ndynamic range. The following are HDR still capture methods where several frames\nwith different exposures are captured and the final HDR result is produced by\nfusing the individual images:\n\n- [HDR scene mode](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_SCENE_MODE_HDR): This mode is implemented at the camera HAL layer and if supported can be set by camera clients within regular camera capture requests.\n- [HDR extension type](https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR): This extension type is recommended for high contrast scenes. Uses a capture session with limited capabilities when compared to regular capture sessions. On the same device, camera extensions can produce results with higher image quality than regular capture requests.\n\nHDR video recording\n-------------------\n\nIn contrast to HDR still capture, video HDR refers only to\n[HDR video capture (10-bit video recording)](https://developer.android.com/training/camera2/hdr-video-capture)."]]