• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef DISPLAY_UTILS_H
16 #define DISPLAY_UTILS_H
17 namespace OHOS {
18 namespace HDI {
19 namespace DISPLAY {
20 class DisplayUtils {
21 public:
IsYuv(PixelFormat format)22     static bool IsYuv(PixelFormat format)
23     {
24         switch (format) {
25             case PIXEL_FMT_YCBCR_420_P:
26             case PIXEL_FMT_YUV_422_I:
27             case PIXEL_FMT_YCBCR_422_SP:
28             case PIXEL_FMT_YCRCB_422_SP:
29             case PIXEL_FMT_YCBCR_420_SP:
30             case PIXEL_FMT_YCRCB_420_SP:
31             case PIXEL_FMT_YCBCR_422_P:
32             case PIXEL_FMT_YCRCB_422_P:
33             case PIXEL_FMT_YCRCB_420_P:
34             case PIXEL_FMT_YUYV_422_PKG:
35             case PIXEL_FMT_UYVY_422_PKG:
36             case PIXEL_FMT_YVYU_422_PKG:
37             case PIXEL_FMT_VYUY_422_PKG:
38                 return true;
39             default:
40                 return false;
41         }
42     }
43 };
44 }
45 }
46 }
47 #endif // DISPLAY_UTILS_H