1 /*
2  * Copyright (c) 2020-2021 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  * @addtogroup UI_Utils
18  * @{
19  *
20  * @brief Defines basic UI utils.
21  *
22  * @since 1.0
23  * @version 1.0
24  */
25 
26 /**
27  * @file image_info.h
28  *
29  * @brief Defines image information.
30  *
31  * @since 1.0
32  * @version 1.0
33  */
34 
35 #ifndef GRAPHIC_LITE_IMAGE_INFO_H
36 #define GRAPHIC_LITE_IMAGE_INFO_H
37 
38 #include <cstdint>
39 
40 namespace OHOS {
41 /**
42  * @brief Defines image head node information.
43  */
44 struct ImageHeader {
45     /** Color format, which is used to match image type. This variable is important. */
46     uint32_t colorMode : 8;
47     uint32_t version : 4;
48     uint32_t compressMode : 4;
49     uint32_t reserved : 16;
50     /** Image width */
51     uint16_t width;
52     /** Image height */
53     uint16_t height;
54 };
55 
56 /**
57  * @brief Defines image information.
58  */
59 struct ImageInfo {
60     /** Image head node information. For details, see {@link ImageHeader}. */
61     ImageHeader header;
62     /** Size of the image data (in bytes) */
63     uint32_t dataSize;
64     /** Pixel color data of pixelmap images */
65     const uint8_t* data;
66     /** User-defined data */
67     void* userData;
68 };
69 } // namespace OHOS
70 #endif // GRAPHIC_LITE_IMAGE_INFO_H
71