Fix build break
[platform/core/api/mediavision.git] / test / testsuites / common / visualizer / include / mv_util_render_2d.h
1 /**
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __MEDIA_VISION_UTIL_RENDER_2D_H__
18 #define __MEDIA_VISION_UTIL_RENDER_2D_H__
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23
24 #include <mv_common.h>
25
26 #ifdef __cplusplus
27 #include <cmath>
28 #else
29 #include <math.h>
30 #endif
31
32 #define pixfmt_fourcc(a, b, c, d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
33
34 typedef struct _texture_2d_t {
35         uint32_t texid;
36         int width;
37         int height;
38         uint32_t format;
39 } texture_2d_t;
40
41 uint32_t create_2d_texture(void *imgbuf, int width, int height);
42 int init_2d_renderer(int w, int h);
43 int load_texture(mv_source_h source, int *lpTexID, int *lpWidth, int *lpHeight);
44 int draw_2d_texture(texture_2d_t *tex, int x, int y, int w, int h, int upsidedown);
45 int egl_init_with_platform_window_surface(int gles_version, int depth_size, int stencil_size, int sample_num, int win_w,
46                                                                                   int win_h);
47 int egl_swap();
48
49 #ifdef __cplusplus
50 }
51 #endif /* __cplusplus */
52
53 #endif /* __MEDIA_VISION_UTIL_RENDER_2D_H__ */