Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Quay video có gam màu rộng
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Đối với các thiết bị chạy Android 14 trở lên, Android hỗ trợ tính năng chụp ảnh gam màu rộng Display P3. Các thiết bị có thể chụp ảnh màu sắc rộng ở định dạng JPEG bằng lớp ImageReader
mà không cần sử dụng HDR 10 bit. Tính năng này cho phép các thiết bị yêu cầu chụp ảnh trong không gian màu gam rộng cho khung Camera2 thông qua tham số setColorSpace
trong SessionConfiguration
.
Yêu cầu
Để hỗ trợ tính năng chụp ảnh có gam màu rộng, thiết bị phải có quyền truy cập vào một máy ảnh có khả năng chụp ảnh có gam màu rộng.
Triển khai
Để hỗ trợ các yêu cầu chụp ảnh có gam màu rộng Display P3, hãy làm như sau:
- Đọc trường
colorSpace
trong
Stream.aidl
và áp dụng trường đó cho luồng đầu ra.
- Triển khai mục siêu dữ liệu
android.request.availableColorSpaceProfilesMap
.
- Báo cáo chức năng
COLOR_SPACE_PROFILES
trong android.request.availableCapabilities
.
Để biết cách triển khai tham chiếu HAL của máy ảnh hỗ trợ chụp dải màu rộng P3, hãy xem nội dung sau trong /hardware/google/camera/devices/EmulatedCamera/hwl/
configs/emu_camera_back.json
:
Để biết thêm thông tin chi tiết về tính năng chụp dải màu rộng trong Camera HAL, hãy xem các giá trị sau trong metadata_definitions.xml
:
API
Đối với các thiết bị chạy Android 14 trở lên có hỗ trợ tính năng chụp dải màu rộng, ứng dụng máy ảnh có thể sử dụng các API công khai sau:
Các giá trị dự kiến cho tham số ColorSpace
được lấy từ lớp ColorSpace.Named
. Trong Android 14, SRGB
, DISPLAY_P3
và BT2020_HLG
được hỗ trợ.
Xác nhận kết quả
Để xác thực việc triển khai tính năng hỗ trợ chụp dải màu rộng Display P3, hãy chạy các chương trình kiểm thử sau.
CTS
android.hardware.camera2.cts.ExtendedCameraCharacteristicsTest#test8BitColorSpaceOutputCharacteristics
android.hardware.camera2.cts.ExtendedCameraCharacteristicsTest#test10BitColorSpaceOutputCharacteristics
android.hardware.camera2.cts.ExtendedCameraCharacteristicsTest#testColorSpaceProfileMap
android.hardware.camera2.cts.ImageReaderTest#testDisplayP3Jpeg
android.hardware.camera2.cts.ImageReaderTest#testDisplayP3JpegRepeating
android.hardware.camera2.cts.ImageReaderTest#testDisplayP3Heic
android.hardware.camera2.cts.ImageReaderTest#testDisplayP3HeicRepeating
ITS
Chạy các chương trình kiểm thử Bộ kiểm thử hình ảnh máy ảnh (ITS) để xác thực những nội dung sau:
- Có cấu hình ICC với toạ độ sắc độ chính xác
- Hình ảnh chứa dữ liệu pixel nằm ngoài gam màu sRGB
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# Wide gamut capture\n\nFor devices running Android 14 or higher, Android\nprovides support for Display P3 wide gamut capture. Devices can capture wide\ngamut color images in JPEG format with the `ImageReader` class without\nusing [10-bit HDR](/docs/core/camera/10-bit-camera-output). This feature lets\ndevices\nrequest camera capture in a wide gamut color space to the Camera2 framework\nthrough the [`setColorSpace`](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#setColorSpace(android.graphics.ColorSpace.Named)) parameter in `SessionConfiguration`.\n\nRequirements\n------------\n\nTo support wide gamut capture, the device must have access to a camera with wide\ngamut color capabilities.\n\nImplementation\n--------------\n\nTo support Display P3 wide gamut capture requests, do the following:\n\n- Read the `colorSpace` field in [`Stream.aidl`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/aidl/android/hardware/camera/device/Stream.aidl) and apply it to the output stream.\n- Implement the `android.request.availableColorSpaceProfilesMap` metadata entry.\n- Report the `COLOR_SPACE_PROFILES` capability in `android.request.availableCapabilities`.\n\nFor a reference Camera HAL implementation supporting P3 wide gamut capture,\nsee the following in `/hardware/google/camera/devices/EmulatedCamera/hwl/\nconfigs/emu_camera_back.json`:\n\n- [`android.request.availableCapabilities`](https://android.googlesource.com/platform/hardware/google/camera/+/refs/heads/android16-release/devices/EmulatedCamera/hwl/configs/emu_camera_back.json#183)\n- [`android.request.availableColorSpaceProfilesMap`](https://android.googlesource.com/platform/hardware/google/camera/+/refs/heads/android16-release/devices/EmulatedCamera/hwl/configs/emu_camera_back.json#211)\n\nFor further details on wide gamut capture in the Camera HAL, see the following\nvalues in `metadata_definitions.xml`:\n\n- [`availableColorSpaceProfiles`](https://android.googlesource.com/platform/system/media/+/refs/heads/android16-release/camera/docs/metadata_definitions.xml#7163)\n- [`availableColorSpaceProfilesMap`](https://android.googlesource.com/platform/system/media/+/refs/heads/android16-release/camera/docs/metadata_definitions.xml#7184)\n- [`COLOR_SPACE_PROFILES`](https://android.googlesource.com/platform/system/media/+/refs/heads/android16-release/camera/docs/metadata_definitions.xml#6610)\n\n### APIs\n\nFor devices running Android 14 or higher with support\nfor wide gamut capture, camera clients can use the following public APIs:\n\n- [`ColorSpaceProfiles`](https://developer.android.com/reference/android/hardware/camera2/params/ColorSpaceProfiles)\n- [`setColorSpace`](https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration#setColorSpace(android.graphics.ColorSpace.Named))\n\nThe expected values for the `ColorSpace` parameter are derived from the\n[`ColorSpace.Named`](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Named)\nclass. In Android 14, `SRGB`, `DISPLAY_P3`,\nand `BT2020_HLG` are supported.\n\nValidation\n----------\n\nTo validate your implementation of Display P3 wide gamut capture support, run\nthe following tests.\n\n### CTS\n\n- `android.hardware.camera2.cts.ExtendedCameraCharacteristicsTest#test8BitColorSpaceOutputCharacteristics`\n- `android.hardware.camera2.cts.ExtendedCameraCharacteristicsTest#test10BitColorSpaceOutputCharacteristics`\n- `android.hardware.camera2.cts.ExtendedCameraCharacteristicsTest#testColorSpaceProfileMap`\n- `android.hardware.camera2.cts.ImageReaderTest#testDisplayP3Jpeg`\n- `android.hardware.camera2.cts.ImageReaderTest#testDisplayP3JpegRepeating`\n- `android.hardware.camera2.cts.ImageReaderTest#testDisplayP3Heic`\n- `android.hardware.camera2.cts.ImageReaderTest#testDisplayP3HeicRepeating`\n\n### ITS\n\nRun the\n[Camera Image Test Suite (ITS)](/docs/compatibility/cts/camera-its)\ntests to validate the following:\n\n- Presence of an ICC profile with correct chromaticity coordinates\n- Image contains pixel data outside the sRGB gamut"]]