• 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 
16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_TEST_MOCK_ROSEN_TESTING_BITMAP_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_TEST_MOCK_ROSEN_TESTING_BITMAP_H
18 
19 namespace OHOS::Ace::Testing {
20 enum ColorType {
21     COLORTYPE_UNKNOWN = 0,
22     COLORTYPE_ALPHA_8,
23     COLORTYPE_RGB_565,
24     COLORTYPE_ARGB_4444,
25     COLORTYPE_RGBA_8888,
26     COLORTYPE_BGRA_8888,
27 };
28 
29 enum AlphaType {
30     ALPHATYPE_UNKNOWN = 0,
31     ALPHATYPE_OPAQUE,
32     ALPHATYPE_PREMUL,
33     ALPHATYPE_UNPREMUL,
34 };
35 
36 struct BitmapFormat {
37     ColorType colorType;
38     AlphaType alphaType;
39 };
40 
41 class TestingBitmap {
42 public:
43     TestingBitmap() = default;
44     ~TestingBitmap() = default;
45 
GetPixels()46     virtual void* GetPixels()
47     {
48         return nullptr;
49     }
50 
Build(const int width,const int height,const BitmapFormat & format)51     virtual void Build(const int width, const int height, const BitmapFormat& format) {}
52 };
53 } // namespace OHOS::Ace::Testing
54 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_BITMAP_H
55