1 /*****************************************************************************
2 * puzzle_lib.h : Useful functions used by puzzle game filter
3 *****************************************************************************
4 * Copyright (C) 2005-2009 VLC authors and VideoLAN
5 * Copyright (C) 2013 Vianney Boyer
8 * Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
9 * Vianney Boyer <vlcvboyer -at- gmail -dot- com>
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 #ifndef VLC_LIB_PUZZLE_H
27 #define VLC_LIB_PUZZLE_H 1
30 /*****************************************************************************
32 *****************************************************************************/
39 #include <vlc_common.h>
40 #include <vlc_plugin.h>
41 #include <vlc_filter.h>
46 void puzzle_preset_desk_background(picture_t
*p_pic_out
, uint8_t Y
, uint8_t U
, uint8_t V
);
47 void puzzle_draw_borders( filter_t
*p_filter
, picture_t
*p_pic_in
, picture_t
*p_pic_out
);
48 void puzzle_draw_preview( filter_t
*p_filter
, picture_t
*p_pic_in
, picture_t
*p_pic_out
);
49 void puzzle_draw_sign(picture_t
*p_pic_out
, int32_t i_x
, int32_t i_y
, int32_t i_width
, int32_t i_lines
, const char **ppsz_sign
, bool b_reverse
);
50 void puzzle_draw_rectangle(picture_t
*p_pic_out
, int32_t x
, int32_t y
, int32_t i_w
, int32_t i_h
, uint8_t Y
, uint8_t U
, uint8_t V
);
51 void puzzle_fill_rectangle(picture_t
*p_pic_out
, int32_t x
, int32_t y
, int32_t i_w
, int32_t i_h
, uint8_t Y
, uint8_t U
, uint8_t V
);
52 static inline int32_t init_countdown(int32_t init_val
) {
53 return ( ( __MAX( 1, 30000 - init_val
)/20 ) / 2 + ((unsigned) vlc_mrand48() ) % ( __MAX( 1, ((30000 - init_val
)/20) ) ) ); }
55 #define SHUFFLE_WIDTH 81
56 #define SHUFFLE_LINES 13
57 extern const char *ppsz_shuffle_button
[SHUFFLE_LINES
];
59 #define ARROW_WIDTH 13
60 #define ARROW_LINES 13
61 extern const char *ppsz_rot_arrow_sign
[ARROW_LINES
];
62 extern const char *ppsz_mir_arrow_sign
[ARROW_LINES
];