]> git.sesse.net Git - vlc/blob - modules/video_filter/puzzle_bezier.h
mediacodec: don't loop in GetOutput
[vlc] / modules / video_filter / puzzle_bezier.h
1 /*****************************************************************************
2  * puzzle_bezier.h : Bezier curves management
3  *****************************************************************************
4  * Copyright (C) 2013 Vianney Boyer
5  * $Id$
6  *
7  * Author:  Vianney Boyer <vlcvboyer -at- gmail -dot- com>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef VLC_LIB_BEZIER_H
25 #define VLC_LIB_BEZIER_H 1
26
27 typedef struct {
28         float f_x, f_y;
29  } point_t;
30
31 point_t *puzzle_scale_curve_H(int32_t i_width, int32_t i_lines, uint8_t i_pts_nbr, point_t *ps_pt, int32_t i_shape_size);
32 point_t *puzzle_H_2_scale_curve_V(int32_t i_width, int32_t i_lines, uint8_t i_pts_nbr, point_t *ps_pt, int32_t i_shape_size);
33 point_t *puzzle_curve_H_2_V(uint8_t i_pts_nbr, point_t *ps_pt);
34 point_t *puzzle_curve_H_2_negative(uint8_t i_pts_nbr, point_t *ps_pt);
35 point_t *puzzle_curve_V_2_negative(uint8_t i_pts_nbr, point_t *ps_pt);
36 point_t *puzzle_rand_bezier(uint8_t i_pts_nbr);
37
38 #define bezier_val(ps_pt,f_sub_t,i_main_t,axis) (( 1 - (f_sub_t))  * ( 1 - (f_sub_t) ) * ( 1 - (f_sub_t) ) * ps_pt[ 3 * (i_main_t)     ].f_ ## axis \
39                                                 +  3 * (f_sub_t)   * ( 1 - (f_sub_t) ) * ( 1 - (f_sub_t) ) * ps_pt[ 3 * (i_main_t) + 1 ].f_ ## axis \
40                                                 +  3 * (f_sub_t)   * (f_sub_t)         * ( 1 - (f_sub_t) ) * ps_pt[ 3 * (i_main_t) + 2 ].f_ ## axis \
41                                                 +      (f_sub_t)   * (f_sub_t)         * (f_sub_t)         * ps_pt[ 3 * (i_main_t) + 3 ].f_ ## axis )
42
43 #endif