xref: /OK3568_Linux_fs/external/linux-rga/samples/utils/utils.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright (C) 2022  Rockchip Electronics Co., Ltd.
3  * Authors:
4  *     YuQiaowei <cerf.yu@rock-chips.com>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef __RGA_SAMPLES_UTILS_H__
20 #define __RGA_SAMPLES_UTILS_H__
21 
22 #include <stdlib.h>
23 
24 int64_t get_cur_us();
25 int64_t get_cur_ms();
26 void draw_rgba(char *buffer, int width, int height);
27 void draw_YUV420(char *buffer, int width, int height);
28 void draw_YUV422(char *buffer, int width, int height);
29 void draw_gray256(char *buffer, int width, int height);
30 int read_image_from_fbc_file(void *buf, const char *path, int sw, int sh, int fmt, int index);
31 int read_image_from_file(void *buf, const char *path, int sw, int sh, int fmt, int index);
32 int write_image_to_fbc_file(void *buf, const char *path, int sw, int sh, int fmt, int index);
33 int write_image_to_file(void *buf, const char *path, int sw, int sh, int fmt, int index);
34 
35 #endif /* #ifndef __RGA_SAMPLES_UTILS_H__ */
36