• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 #ifndef OHOS_AAFWK_INTERFACES_INNERKITS_IMAGE_INFO_H
17 #define OHOS_AAFWK_INTERFACES_INNERKITS_IMAGE_INFO_H
18 
19 #include <string>
20 
21 #include "ability_record_info.h"
22 #include "mission_description_info.h"
23 #include "parcel.h"
24 #include "want.h"
25 
26 namespace OHOS {
27 namespace AAFwk {
28 /**
29  * @struct ImageInfo
30  * Defines image header information.
31  */
32 struct ImageHeader : public Parcelable {
33     /**
34      * Color format, which is used to match image type. This variable is important.
35      */
36     uint32_t colorMode = 8;
37 
38     uint32_t reserved = 24;
39 
40     uint16_t width;
41 
42     uint16_t height;
43 
44     bool ReadFromParcel(Parcel &parcel);
45     virtual bool Marshalling(Parcel &parcel) const override;
46     static ImageHeader *Unmarshalling(Parcel &parcel);
47 };
48 
49 /**
50  * @struct ImageInfo
51  * Defines image information.
52  */
53 struct ImageInfo : public Parcelable {
54     ImageHeader header;
55 
56     /**
57      * Size of the image data (in bytes)
58      */
59     uint32_t dataSize;
60 
61     uint8_t *data;
62 
63     uint32_t userDataSize;
64     /**
65      * User-defined data
66      */
67     void *userData;
68 
69     bool ReadFromParcel(Parcel &parcel);
70     virtual bool Marshalling(Parcel &parcel) const override;
71     static ImageInfo *Unmarshalling(Parcel &parcel);
72 };
73 }  // namespace AAFwk
74 }  // namespace OHOS
75 #endif  // OHOS_AAFWK_INTERFACES_INNERKITS_IMAGE_INFO_H