xref: /OK3568_Linux_fs/external/rknpu2/examples/rknn_yolov5_demo/include/rga_func.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 #ifndef __RGA_FUNC_H__
2 #define __RGA_FUNC_H__
3 
4 #include <dlfcn.h>
5 #include "RgaApi.h"
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 typedef int(* FUNC_RGA_INIT)();
12 typedef void(* FUNC_RGA_DEINIT)();
13 typedef int(* FUNC_RGA_BLIT)(rga_info_t *, rga_info_t *, rga_info_t *);
14 
15 typedef struct _rga_context{
16     void *rga_handle;
17     FUNC_RGA_INIT init_func;
18     FUNC_RGA_DEINIT deinit_func;
19     FUNC_RGA_BLIT blit_func;
20 } rga_context;
21 
22 int RGA_init(rga_context* rga_ctx);
23 
24 void img_resize_fast(rga_context *rga_ctx, int src_fd, int src_w, int src_h, uint64_t dst_phys, int dst_w, int dst_h);
25 
26 void img_resize_slow(rga_context *rga_ctx, void *src_virt, int src_w, int src_h, void *dst_virt, int dst_w, int dst_h);
27 
28 int RGA_deinit(rga_context* rga_ctx);
29 
30 #ifdef __cplusplus
31 }
32 #endif
33 #endif/*__RGA_FUNC_H__*/
34