WinGui: Fix another instance of the Caliburn vs Json.net sillyness where objects...
[HandBrake.git] / libhb / deccc608sub.h
blobd01209f62e56c5077d38d2560cb55c9eeb4e456b
1 /* deccc608sub.h
3 Copyright (c) 2003-2015 HandBrake Team
4 This file is part of the HandBrake source code
5 Homepage: <http://handbrake.fr/>.
6 It may be used under the terms of the GNU General Public License v2.
7 For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html
8 */
11 * From ccextractor...
13 #ifndef __DECCC608SUB_H__
14 #define __DECCC608SUB_H__
16 #include "common.h"
18 struct s_write;
20 #define CC608_SCREEN_WIDTH 32
22 enum cc_modes
24 MODE_POPUP = 0,
25 MODE_ROLLUP_2 = 1,
26 MODE_ROLLUP_3 = 2,
27 MODE_ROLLUP_4 = 3,
28 MODE_TEXT = 4
31 enum color_code
33 COL_WHITE = 0,
34 COL_GREEN = 1,
35 COL_BLUE = 2,
36 COL_CYAN = 3,
37 COL_RED = 4,
38 COL_YELLOW = 5,
39 COL_MAGENTA = 6,
40 COL_USERDEFINED = 7
44 enum font_bits
46 FONT_REGULAR = 0,
47 FONT_ITALICS = 1,
48 FONT_UNDERLINED = 2,
49 FONT_UNDERLINED_ITALICS = 3
52 #define FONT_STYLE_MASK FONT_UNDERLINED_ITALICS
54 struct eia608_screen // A CC buffer
56 unsigned char characters[15][33];
57 unsigned char colors[15][33];
58 unsigned char fonts[15][33]; // Extra char at the end for a 0
59 int row_used[15]; // Any data in row?
60 int empty; // Buffer completely empty?
61 int dirty; // Flag indicates buffer has changed since written
64 struct eia608
66 struct eia608_screen buffer1;
67 struct eia608_screen buffer2;
68 int cursor_row, cursor_column;
69 int visible_buffer;
70 int ssa_counter; // Number of subs currently written
71 int screenfuls_counter; // Number of meaningful screenfuls written
72 int64_t current_visible_start_ms; // At what time did the current visible buffer became so?
73 enum cc_modes mode;
74 unsigned char last_c1, last_c2;
75 int channel; // Currently selected channel
76 unsigned char color; // Color we are currently using to write
77 unsigned char font; // Font we are currently using to write
78 int rollup_base_row;
81 struct s_write {
82 struct eia608 *data608;
83 FILE *fh;
84 unsigned char *subline;
85 int new_sentence;
86 int new_channel;
87 int in_xds_mode;
88 hb_buffer_t *hb_buffer;
89 hb_buffer_t *hb_last_buffer;
90 uint64_t last_pts;
91 unsigned char *enc_buffer; // Generic general purpose buffer
92 unsigned enc_buffer_used;
93 unsigned enc_buffer_capacity;
95 int clear_sub_needed; // Indicates that we need to send a null
96 // subtitle to clear the current subtitle
98 int rollup_cr; // Flag indicates if CR command performed by rollup
99 int direct_rollup;
100 int line; // SSA line number
101 int width;
102 int height;
103 int crop[4];
104 hb_rational_t par;
105 uint8_t prev_font_style;
106 uint8_t prev_font_color;
109 enum command_code
111 COM_UNKNOWN = 0,
112 COM_ERASEDISPLAYEDMEMORY = 1,
113 COM_RESUMECAPTIONLOADING = 2,
114 COM_ENDOFCAPTION = 3,
115 COM_TABOFFSET1 = 4,
116 COM_TABOFFSET2 = 5,
117 COM_TABOFFSET3 = 6,
118 COM_ROLLUP2 = 7,
119 COM_ROLLUP3 = 8,
120 COM_ROLLUP4 = 9,
121 COM_CARRIAGERETURN = 10,
122 COM_ERASENONDISPLAYEDMEMORY = 11,
123 COM_BACKSPACE = 12,
124 COM_RESUMETEXTDISPLAY = 13
127 enum encoding_type
129 ENC_UNICODE = 0,
130 ENC_LATIN_1 = 1,
131 ENC_UTF_8 = 2
134 enum output_format
136 OF_RAW = 0,
137 OF_SRT = 1,
138 OF_SAMI = 2,
139 OF_TRANSCRIPT = 3,
140 OF_RCWT = 4
143 #endif // __DECCC608SUB_H__