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