ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
การจับภาพแบบช่วงสีกว้าง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สำหรับอุปกรณ์ที่ใช้ Android 14 ขึ้นไป Android จะรองรับการจับภาพแบบช่วงสีกว้าง Display P3 อุปกรณ์สามารถจับภาพสีแบบช่วงกว้างในรูปแบบ JPEG คลาส ImageReader
โดยไม่ต้องใช้ HDR 10 บิต ฟีเจอร์นี้ช่วยให้อุปกรณ์ส่งคำขอการจับภาพด้วยกล้องในพื้นที่สีแบบช่วงกว้างไปยังเฟรมเวิร์ก Camera2 ผ่านพารามิเตอร์ setColorSpace
ใน SessionConfiguration
ข้อกำหนด
หากต้องการรองรับการจับภาพแบบช่วงสีกว้าง อุปกรณ์ต้องมีสิทธิ์เข้าถึงกล้องที่รองรับสีแบบช่วงสีกว้าง
การใช้งาน
หากต้องการรองรับคำขอการจับภาพแบบช่วงสีกว้าง Display P3 ให้ทำดังนี้
- อ่านช่อง
colorSpace
ใน
Stream.aidl
และนำไปใช้กับสตรีมเอาต์พุต
- ใช้ข้อมูลเมตา
android.request.availableColorSpaceProfilesMap
รายการ
- รายงานความสามารถของ
COLOR_SPACE_PROFILES
ใน
android.request.availableCapabilities
สําหรับการใช้งาน Camera HAL อ้างอิงที่รองรับการจับภาพแบบช่วงสีกว้าง P3 ให้ดูข้อมูลต่อไปนี้ใน /hardware/google/camera/devices/EmulatedCamera/hwl/
configs/emu_camera_back.json
ดูรายละเอียดเพิ่มเติมเกี่ยวกับการจับภาพแบบช่วงสีกว้างใน HAL ของกล้องได้ที่ค่าต่อไปนี้ใน metadata_definitions.xml
API
สำหรับอุปกรณ์ที่ใช้ Android 14 ขึ้นไปที่รองรับการจับภาพแบบช่วงสีกว้าง โปรแกรมรับส่งข้อมูลของกล้องจะใช้ API สาธารณะต่อไปนี้ได้
ค่าที่คาดไว้สําหรับพารามิเตอร์ ColorSpace
มาจากคลาส ColorSpace.Named
ใน Android 14 ระบบจะรองรับ SRGB
, DISPLAY_P3
และBT2020_HLG
การตรวจสอบความถูกต้อง
หากต้องการตรวจสอบการติดตั้งใช้งานการรองรับการจับภาพแบบช่วงสีกว้าง Display P3 ให้ทําการทดสอบต่อไปนี้
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
เรียกใช้การทดสอบจากชุดทดสอบภาพจากกล้อง (ITS) เพื่อตรวจสอบสิ่งต่อไปนี้
- การมีโปรไฟล์ ICC ที่มีพิกัดสีที่ถูกต้อง
- รูปภาพมีข้อมูลพิกเซลที่อยู่นอกช่วงสี sRGB
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[[["เข้าใจง่าย","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 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"]]