TIOVX User Guide
tivx_utils_bmp.h
1 /*
2 
3  * Copyright (c) 2012-2017 The Khronos Group Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /*
19  *
20  * Copyright (c) 2020 Texas Instruments Incorporated
21  *
22  */
23 
24 #if !defined(_TIVX_UTILS_BMP_H_)
25 #define _TIVX_UTILS_BMP_H_
26 
27 #include <stdio.h>
28 #include <stdint.h>
29 
30 #include <VX/vx.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct
37 {
39  uint32_t width;
40 
42  uint32_t height;
43 
45  uint16_t bpp;
46 
48  uint32_t stride_y;
49 
51  vx_df_image format;
52 
54  uint8_t *data;
55 
57  uint32_t dataSize;
58 
59 } tivx_utils_bmp_image_params_t;
60 
61 int32_t tivx_utils_bmp_read_mem(const uint8_t *data,
62  uint32_t dataSize,
63  int32_t dcn,
64  tivx_utils_bmp_image_params_t *imgParams);
65 
66 int32_t tivx_utils_bmp_read(const char *filename,
67  int32_t dcn,
68  tivx_utils_bmp_image_params_t *imgParams);
69 
70 int32_t tivx_utils_bmp_read_release(tivx_utils_bmp_image_params_t *imgParams);
71 
72 int32_t tivx_utils_bmp_write(const char *filename,
73  const uint8_t *data,
74  int32_t width,
75  int32_t height,
76  int32_t stride_y,
77  vx_df_image df);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif /* _TIVX_UTILS_BMP_H_ */
84 
uint32_t vx_df_image