1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @file display_format.h 18 * 19 * @brief Declares display format-related enumeration. 20 * 21 * @since 1.0 22 * @version 1.0 23 */ 24 25 #ifndef DISPLAY_FORMAT_H 26 #define DISPLAY_FORMAT_H 27 28 #include <cstdint> 29 30 namespace OHOS::Camera { 31 32 enum BufferUsage : uint64_t { 33 HBM_USE_CPU_READ = (1ULL << 0), 34 HBM_USE_CPU_WRITE = (1ULL << 1), 35 HBM_USE_MEM_MMZ = (1ULL << 2), 36 HBM_USE_MEM_DMA = (1ULL << 3), 37 HBM_USE_MEM_SHARE = (1ULL << 4), 38 HBM_USE_MEM_MMZ_CACHE = (1ULL << 5), 39 HBM_USE_MEM_FB = (1ULL << 6), 40 HBM_USE_ASSIGN_SIZE = (1ULL << 7), 41 HBM_USE_HW_RENDER = (1ULL << 8), 42 HBM_USE_HW_TEXTURE = (1ULL << 9), 43 HBM_USE_HW_COMPOSER = (1ULL << 10), 44 HBM_USE_PROTECTED = (1ULL << 11), 45 HBM_USE_CAMERA_READ = (1ULL << 12), 46 HBM_USE_CAMERA_WRITE = (1ULL << 13), 47 HBM_USE_VIDEO_ENCODER = (1ULL << 14), 48 HBM_USE_VIDEO_DECODER = (1ULL << 15), 49 HBM_USE_CPU_READ_OFTEN = (1ULL << 16), 50 HBM_USE_VENDOR_PRI0 = (1ULL << 44), 51 HBM_USE_VENDOR_PRI1 = (1ULL << 45), 52 HBM_USE_VENDOR_PRI2 = (1ULL << 46), 53 HBM_USE_VENDOR_PRI3 = (1ULL << 47), 54 HBM_USE_VENDOR_PRI4 = (1ULL << 48), 55 HBM_USE_VENDOR_PRI5 = (1ULL << 49), 56 HBM_USE_VENDOR_PRI6 = (1ULL << 50), 57 HBM_USE_VENDOR_PRI7 = (1ULL << 51), 58 HBM_USE_VENDOR_PRI8 = (1ULL << 52), 59 HBM_USE_VENDOR_PRI9 = (1ULL << 53), 60 HBM_USE_VENDOR_PRI10 = (1ULL << 54), 61 HBM_USE_VENDOR_PRI11 = (1ULL << 55), 62 HBM_USE_VENDOR_PRI12 = (1ULL << 56), 63 HBM_USE_VENDOR_PRI13 = (1ULL << 57), 64 HBM_USE_VENDOR_PRI14 = (1ULL << 58), 65 HBM_USE_VENDOR_PRI15 = (1ULL << 59), 66 HBM_USE_VENDOR_PRI16 = (1ULL << 60), 67 HBM_USE_VENDOR_PRI17 = (1ULL << 61), 68 HBM_USE_VENDOR_PRI18 = (1ULL << 62), 69 HBM_USE_VENDOR_PRI19 = (1ULL << 63), 70 }; 71 72 enum PixelFormat : int32_t { 73 PIXEL_FMT_CLUT8 = 0, 74 PIXEL_FMT_CLUT1, 75 PIXEL_FMT_CLUT4, 76 PIXEL_FMT_RGB_565, 77 PIXEL_FMT_RGBA_5658, 78 PIXEL_FMT_RGBX_4444, 79 PIXEL_FMT_RGBA_4444, 80 PIXEL_FMT_RGB_444, 81 PIXEL_FMT_RGBX_5551, 82 PIXEL_FMT_RGBA_5551, 83 PIXEL_FMT_RGB_555, 84 PIXEL_FMT_RGBX_8888, 85 PIXEL_FMT_RGBA_8888, 86 PIXEL_FMT_RGB_888, 87 PIXEL_FMT_BGR_565, 88 PIXEL_FMT_BGRX_4444, 89 PIXEL_FMT_BGRA_4444, 90 PIXEL_FMT_BGRX_5551, 91 PIXEL_FMT_BGRA_5551, 92 PIXEL_FMT_BGRX_8888, 93 PIXEL_FMT_BGRA_8888, 94 PIXEL_FMT_YUV_422_I, 95 PIXEL_FMT_YCBCR_422_SP, 96 PIXEL_FMT_YCRCB_422_SP, 97 PIXEL_FMT_YCBCR_420_SP, 98 PIXEL_FMT_YCRCB_420_SP, 99 PIXEL_FMT_YCBCR_422_P, 100 PIXEL_FMT_YCRCB_422_P, 101 PIXEL_FMT_YCBCR_420_P, 102 PIXEL_FMT_YCRCB_420_P, 103 PIXEL_FMT_YUYV_422_PKG, 104 PIXEL_FMT_UYVY_422_PKG, 105 PIXEL_FMT_YVYU_422_PKG, 106 PIXEL_FMT_VYUY_422_PKG, 107 PIXEL_FMT_RGBA_1010102, 108 PIXEL_FMT_YCBCR_P010, 109 PIXEL_FMT_YCRCB_P010, 110 PIXEL_FMT_RAW10, 111 PIXEL_FMT_VENDER_MASK = 0X7FFF0000, 112 PIXEL_FMT_BUTT = 0X7FFFFFFF, 113 }; 114 115 enum OhosColorSpace { 116 OHOS_CAMERA_COLORSPACE_NONE, 117 // COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_FULL << 21) 118 OHOS_CAMERA_BT709_FULL = 1 | (1 << 8) | (1 << 16) | (1 << 21), 119 // COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) 120 OHOS_CAMERA_BT2020_HLG_FULL = 4 | (5 << 8) | (4 << 16) | (1 << 21), 121 // COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) 122 OHOS_CAMERA_BT2020_PQ_FULL = 4 | (4 << 8) | (4 << 16) | (1 << 21), 123 // COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21) 124 OHOS_CAMERA_SRGB_FULL = 1 | (2 << 8) | (3 << 16) | (1 << 21), 125 // COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) 126 OHOS_CAMERA_P3_FULL = 6 | (2 << 8) | (3 << 16) | (1 << 21), 127 }; 128 129 } // end namespace OHOS::Camera 130 #endif 131