תיקון צבעים באמצעות טבלאות בדיקה (LUT)
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יכולות ה-HDR משתנות בין מכשירי Android, ולכן פלט ה-HDR של התצוגה עשוי להיות מקוטע. טבלת בדיקה (LUT) היא פתרון חדש לתיקון צבעים שנועד לפתור את חוסר העקביות הזה. כדי לפתור את חוסר העקביות הזה, נקבע אופן תיקון הצבעים, במקום להסתמך על מנגנון לא מוגדר לתיקון צבעים בכל מכשיר.
דרישות מוקדמות ל-SDK
כדי להטמיע טבלאות LUT, גרסת ה-SDK צריכה להיות 36 ומעלה.
הטמעה של LUT
כדי להחיל LUT על SurfaceControl
:
- יוצרים מכונת
DisplayLuts
.
- יוצרים מופע אחד או יותר של
DisplayLuts.Entry
עם מאגר נתוני טבלת המיפוי, מאפיין טבלת המיפוי ומפתח הדגימה של טבלת המיפוי. מידע נוסף זמין במאמרי העזרה בנושא LutProperties
.
- כדי להגדיר רשומות של טבלת LUT, מתקשרים למספר
DisplayLuts#set(DisplayLuts.Entry luts)
או למספר DisplayLuts#set(DisplayLuts.Entry first, DisplayLuts.Entry second)
. המסגרת תומכת בטבלאות מיפוי חד-ממדיות, בטבלאות מיפוי תלת-ממדיות או בשילוב של טבלאות מיפוי חד-ממדיות ותלת-ממדיות.
- מתקשרים למספר
SurfaceControl.Transaction#setLuts
כדי להחיל את טבלאות ה-LUT על השכבה.
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()
כדי להבין את מאפייני ה-LUT של המכשיר ולקבוע אם Hardware Composer יכול לטפל ב-LUT שנבחר.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. 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."]]