• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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_IMAGE_UTILS_H
17 #define OHOS_IMAGE_UTILS_H
18 
19 #include <cstdint>
20 #include <memory>
21 #include <string>
22 
23 const int64_t INIT_FAILED = -1;
24 
25 extern "C" {
26 typedef struct {
27     int32_t height;
28     int32_t width;
29 } CSize;
30 
31 typedef struct {
32     CSize size;
33     int32_t x;
34     int32_t y;
35 } CRegion;
36 
37 typedef struct {
38     int32_t componentType;
39     int32_t rowStride;
40     int32_t pixelStride;
41     uint8_t* byteBuffer;
42     int64_t bufSize;
43 } CRetComponent;
44 
45 typedef struct {
46     uint64_t bufferSize;
47     uint32_t offset;
48     uint32_t stride;
49     CRegion region;
50     uint8_t* dst;
51 } CPositionArea;
52 
53 typedef struct {
54     uint8_t* data;
55     size_t arrSize;
56     uint32_t offset;
57     uint32_t updateLen;
58     bool isCompleted;
59 } UpdateDataInfo;
60 }
61 
62 #define FFI_EXPORT __attribute__((visibility("default")))
63 
64 #endif