1 #pragma once 2 3 #include <aidl/android/hardware/graphics/common/PixelFormat.h> 4 5 #include <cstdint> 6 7 namespace pixel::graphics { 8 9 using FrameworkFormat = aidl::android::hardware::graphics::common::PixelFormat; 10 11 #define MapFormat(f) f = static_cast<uint32_t>(FrameworkFormat::f) 12 13 enum class Format : uint32_t { 14 MapFormat(UNSPECIFIED), 15 MapFormat(RGBA_8888), 16 MapFormat(RGBX_8888), 17 MapFormat(RGB_888), 18 MapFormat(RGB_565), 19 MapFormat(BGRA_8888), 20 MapFormat(YCBCR_422_SP), 21 MapFormat(YCRCB_420_SP), 22 MapFormat(YCBCR_422_I), 23 MapFormat(RGBA_FP16), 24 MapFormat(RAW16), 25 MapFormat(BLOB), 26 MapFormat(IMPLEMENTATION_DEFINED), 27 MapFormat(YCBCR_420_888), 28 MapFormat(RAW_OPAQUE), 29 MapFormat(RAW10), 30 MapFormat(RAW12), 31 MapFormat(RGBA_1010102), 32 MapFormat(Y8), 33 MapFormat(Y16), 34 MapFormat(YV12), 35 MapFormat(DEPTH_16), 36 MapFormat(DEPTH_24), 37 MapFormat(DEPTH_24_STENCIL_8), 38 MapFormat(DEPTH_32F), 39 MapFormat(DEPTH_32F_STENCIL_8), 40 MapFormat(STENCIL_8), 41 MapFormat(YCBCR_P010), 42 MapFormat(HSV_888), 43 MapFormat(R_8), 44 MapFormat(R_16_UINT), 45 MapFormat(RG_1616_UINT), 46 MapFormat(RGBA_10101010), 47 48 // Pixel specific formats 49 GOOGLE_NV12 = 0x301, 50 GOOGLE_RGBX16 = 0x302, 51 GOOGLE_R8 = 0x303, 52 /** 53 * 48-bit format that has 16-bit R, G, B components, in that order, 54 * from the lowest memory address to the highest memory address. 55 */ 56 GOOGLE_RGB16 = 0x304, 57 GOOGLE_BGRX = 0x305, 58 59 /** 60 * 2 plane format following [x:Y2:Y1:Y0], [x:Cr2:Cb2:Cr1 x:Cb1:Cr0:Cb0] 61 * With each Y, Cr and Cb being 10 bits, and x representing 2 bits padding 62 */ 63 GOOGLE_YCBCR_P030 = 0x306, 64 }; 65 66 #undef MapFormat 67 68 } // namespace pixel::graphics 69