Android 기기마다 HDR 기능이 다르기 때문에 HDR 디스플레이 출력이 단편화될 수 있습니다. 룩업 테이블 (LUT)은 이러한 불일치를 해결하기 위해 설계된 새로운 색상 보정 솔루션입니다. 이 불일치는 정의되지 않은 기기별 색상 보정 메커니즘에 위임하는 대신 색상 보정 방법을 지정하여 해결됩니다.
SDK 기본 요건
LUT를 구현하려면 SDK 버전이 36 이상이어야 합니다.
LUT 구현
LUT를 SurfaceControl
에 적용하려면 다음 단계를 따르세요.
DisplayLuts
인스턴스를 만듭니다.- LUT 데이터 버퍼, LUT 차원, LUT의 샘플링 키를 사용하여
DisplayLuts.Entry
인스턴스를 만듭니다. 자세한 내용은LutProperties
문서를 참고하세요. DisplayLuts#set(DisplayLuts.Entry luts)
또는DisplayLuts#set(DisplayLuts.Entry first, DisplayLuts.Entry second)
를 호출하여 LUT 항목을 설정합니다. 프레임워크는 1D LUT, 3D LUT 또는 1D 및 3D LUT의 조합을 지원합니다.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()
자바
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 속성을 파악하고 하드웨어 컴포저가 선택한 LUT를 처리할 수 있는지 확인할 수도 있습니다.