लुक-अप टेबल (एलयूटी) की मदद से, रंग ठीक करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Android डिवाइसों में एचडीआर की अलग-अलग सुविधाएं होने की वजह से, एचडीआर डिसप्ले आउटपुट अलग-अलग हो सकते हैं. लुक-अप टेबल (एलयूटी), रंग को ठीक करने का नया तरीका है. इसे इस समस्या को हल करने के लिए डिज़ाइन किया गया है. इस समस्या को हल करने के लिए, रंग में सुधार करने का तरीका तय किया गया है. इसके बजाय, हर डिवाइस के लिए रंग में सुधार करने की सुविधा को किसी अनडिफ़ाइंड तरीके से डेलिगेट किया गया है.
एसडीके टूल इस्तेमाल करने की ज़रूरी शर्तें
एलयूटी लागू करने के लिए, आपके SDK टूल का वर्शन 36 या इसके बाद का होना चाहिए.
एलयूटी लागू करना
किसी SurfaceControl
पर एलयूटी लागू करने के लिए, यह तरीका अपनाएं:
DisplayLuts
इंस्टेंस बनाएं.
- एलयूटी डेटा बफ़र, एलयूटी डाइमेंशन, और एलयूटी की सैंपलिंग कुंजी का इस्तेमाल करके,
DisplayLuts.Entry
इंस्टेंस बनाएं. ज़्यादा जानकारी के लिए, LutProperties
दस्तावेज़ देखें.
- एलयूटी एंट्री सेट करने के लिए,
DisplayLuts#set(DisplayLuts.Entry luts)
या
DisplayLuts#set(DisplayLuts.Entry first, DisplayLuts.Entry second)
पर कॉल करें. यह फ़्रेमवर्क, 1D एलयूटी, 3D एलयूटी या 1D और 3D एलयूटी के कॉम्बिनेशन के साथ काम करता है.
- लेयर पर एलयूटी लागू करने के लिए,
SurfaceControl.Transaction#setLuts
को कॉल करें.
Kotlin
val sc = SurfaceControl.Builder().build()
val luts = DisplayLuts()
val entry = DisplayLuts.Entry(
floatArrayOf(0.5f, 0.5f, 0.5f, 0.5f),
LutProperties.ONE_DIMENSION,
LutProperties.SAMPLING_KEY_MAX_RGB
)
luts.set(entry)
SurfaceControl.Transaction().setLuts(sc, luts).apply()
Java
SurfaceControl sc = new SurfaceControl.Builder().build();
DisplayLuts luts = new DisplayLuts();
DisplayLuts.Entry entry = new DisplayLuts.Entry(
new float[]{0.5f, 0.5f, 0.5f, 0.5f},
LutProperties.ONE_DIMENSION,
LutProperties.SAMPLING_KEY_MAX_RGB
);
luts.set(entry);
new SurfaceControl.Transaction().setLuts(sc, luts).apply();
डिवाइस की एलयूटी प्रॉपर्टी के बारे में जानने के लिए, OverlayProperties.getLutProperties()
का इस्तेमाल किया जा सकता है. इससे यह भी पता लगाया जा सकता है कि हार्डवेयर कंपोज़र, चुनी गई एलयूटी को मैनेज कर सकता है या नहीं.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया."],[],[],null,["# Color correct with look-up tables (LUTs)\n\nVarying HDR capabilities across Android devices can lead to fragmented HDR\ndisplay outputs. A look-up table (LUT) is a new color correction solution\ndesigned to resolve this inconsistency. This inconsistency is resolved by\n*prescribing* a way to color correct, rather than delegating to an undefined\nper-device color correction mechanism.\n\nSDK prerequisites\n-----------------\n\nTo implement LUTs, your SDK version must 36 or higher.\n\nImplement a LUT\n---------------\n\nFollow these steps to apply a LUT to a [`SurfaceControl`](/reference/android/view/SurfaceControl):\n\n1. Create a [`DisplayLuts`](/reference/android/hardware/DisplayLuts) instance.\n2. Create [`DisplayLuts.Entry`](/reference/android/hardware/DisplayLuts.Entry) instance(s) with the LUT data buffer, LUT dimension, and the sampling key of the LUT. For more information, see [`LutProperties`](/reference/android/hardware/LutProperties) documentation.\n3. Call [`DisplayLuts#set(DisplayLuts.Entry luts)`](/reference/android/hardware/DisplayLuts#set(android.hardware.DisplayLuts.Entry)) or [`DisplayLuts#set(DisplayLuts.Entry first, DisplayLuts.Entry second)`](/reference/android/hardware/DisplayLuts#set(android.hardware.DisplayLuts.Entry,%20android.hardware.DisplayLuts.Entry)) to set LUT entries. The framework supports 1D LUT, 3D LUT, or a combination of 1D and 3D LUTs.\n4. Call [`SurfaceControl.Transaction#setLuts`](/reference/android/view/SurfaceControl.Transaction#setLuts(android.view.SurfaceControl,%20android.hardware.DisplayLuts)) to apply the LUTs to the layer.\n\n### Kotlin\n\n val sc = SurfaceControl.Builder().build()\n val luts = DisplayLuts()\n val entry = DisplayLuts.Entry(\n floatArrayOf(0.5f, 0.5f, 0.5f, 0.5f),\n LutProperties.ONE_DIMENSION,\n LutProperties.SAMPLING_KEY_MAX_RGB\n )\n luts.set(entry)\n SurfaceControl.Transaction().setLuts(sc, luts).apply()\n\n### Java\n\n SurfaceControl sc = new SurfaceControl.Builder().build();\n DisplayLuts luts = new DisplayLuts();\n DisplayLuts.Entry entry = new DisplayLuts.Entry(\n new float[]{0.5f, 0.5f, 0.5f, 0.5f},\n LutProperties.ONE_DIMENSION,\n LutProperties.SAMPLING_KEY_MAX_RGB\n );\n luts.set(entry);\n new SurfaceControl.Transaction().setLuts(sc, luts).apply();\n\nYou can also use [`OverlayProperties.getLutProperties()`](/reference/android/hardware/OverlayProperties#getLutProperties()) to understand the\nLUT properties of the device, and determine if the Hardware Composer can handle\nthe selected LUT."]]