1 /* 2 * Copyright (c) 2022 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 #include "display_utils.h" 16 #include "display_common.h" 17 #include "display_type.h" 18 namespace OHOS { 19 namespace HDI { 20 namespace DISPLAY { IsYuv(PixelFormat format)21bool DisplayUtils::IsYuv(PixelFormat format) 22 { 23 switch (format) { 24 case PIXEL_FMT_YCBCR_420_P: 25 case PIXEL_FMT_YUV_422_I: 26 case PIXEL_FMT_YCBCR_422_SP: 27 case PIXEL_FMT_YCRCB_422_SP: 28 case PIXEL_FMT_YCBCR_420_SP: 29 case PIXEL_FMT_YCRCB_420_SP: 30 case PIXEL_FMT_YCBCR_422_P: 31 case PIXEL_FMT_YCRCB_422_P: 32 case PIXEL_FMT_YCRCB_420_P: 33 case PIXEL_FMT_YUYV_422_PKG: 34 case PIXEL_FMT_UYVY_422_PKG: 35 case PIXEL_FMT_YVYU_422_PKG: 36 case PIXEL_FMT_VYUY_422_PKG: 37 return true; 38 default: 39 return false; 40 } 41 } 42 } 43 } 44 }