1 #ifndef _hardsubs__hpp__included__
2 #define _hardsubs__hpp__included__
5 #include "newpacket.hpp"
12 #define ALIGN_CENTER 1
14 #define ALIGN_BOTTOM 2
15 #define ALIGN_CUSTOM 3
19 #define DEFAULT_FONT_SIZE 16
20 #define DEFAULT_HALO_THICKNESS 0
21 #define DEFAULT_FOREGROUND_R 255
22 #define DEFAULT_FOREGROUND_G 255
23 #define DEFAULT_FOREGROUND_B 255
24 #define DEFAULT_FOREGROUND_A 255
25 #define DEFAULT_HALO_R 0
26 #define DEFAULT_HALO_G 0
27 #define DEFAULT_HALO_B 0
28 #define DEFAULT_HALO_A 255
29 #define DEFAULT_BACKGROUND_R 0
30 #define DEFAULT_BACKGROUND_G 0
31 #define DEFAULT_BACKGROUND_B 0
32 #define DEFAULT_BACKGROUND_A 0
33 #define DEFAULT_ALIGN_TYPE ALIGN_CENTER
34 #define DEFAULT_SPACING 1
35 #define DEFAULT_DURATION 5000000000ULL
36 #define DEFAULT_XALIGN_TYPE ALIGN_CENTER
37 #define DEFAULT_YALIGN_TYPE ALIGN_BOTTOM
39 struct hardsub_render_settings
41 std::string font_name
;
43 uint32_t halo_thickness
;
59 image_frame_rgbx
* operator()();
62 struct hardsub_settings
66 struct hardsub_render_settings rsettings
;
73 subtitle
* operator()();
84 struct hardsub_render_settings used_settings
;
85 image_frame_rgbx
* subtitle_img
;
89 void render_subtitle(image_frame_rgbx
& bottom
, struct subtitle
& sub
);
90 std::list
<subtitle
*> parse_subtitle_option(struct hardsub_settings
& settings
, const std::string
& option
);
91 void print_hardsubs_help(const std::string
& prefix
);
92 std::list
<subtitle
*> process_hardsubs_options(struct hardsub_settings
& settings
, const std::string
& prefix
, int argc
, char** argv
);
93 void subtitle_update_parameter(std::list
<subtitle
*>& subs
, unsigned char parameter
, const std::string
& value
);
94 void subtitle_process_gameinfo(std::list
<subtitle
*>& subs
, struct packet
& p
);