increase max glyph and lines limit
[mplayer/glamo.git] / libvo / sub.h
blobb16cd77a60a18296a351e16754ce82fc2d94d19c
2 #ifndef MPLAYER_SUB_H
3 #define MPLAYER_SUB_H
5 typedef struct mp_osd_bbox_s {
6 int x1,y1,x2,y2;
7 } mp_osd_bbox_t;
9 #define OSDTYPE_OSD 1
10 #define OSDTYPE_SUBTITLE 2
11 #define OSDTYPE_PROGBAR 3
12 #define OSDTYPE_SPU 4
13 #define OSDTYPE_DVDNAV 5
14 #define OSDTYPE_TELETEXT 6
16 #define OSDFLAG_VISIBLE 1
17 #define OSDFLAG_CHANGED 2
18 #define OSDFLAG_BBOX 4
19 #define OSDFLAG_OLD_BBOX 8
20 #define OSDFLAG_FORCE_UPDATE 16
22 #define MAX_UCS 1600
23 #define MAX_UCSLINES 16
25 typedef struct mp_osd_obj_s {
26 struct mp_osd_obj_s* next;
27 unsigned char type;
28 unsigned char alignment; // 2 bits: x;y percentages, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
29 unsigned short flags;
30 int x,y;
31 int dxs,dys;
32 mp_osd_bbox_t bbox; // bounding box
33 mp_osd_bbox_t old_bbox; // the renderer will save bbox here
34 union {
35 struct {
36 void* sub; // value of vo_sub at last update
37 int utbl[MAX_UCS+1]; // subtitle text
38 int xtbl[MAX_UCSLINES]; // x positions
39 int lines; // no. of lines
40 } subtitle;
41 struct {
42 int elems;
43 } progbar;
44 } params;
45 int stride;
47 int allocated;
48 unsigned char *alpha_buffer;
49 unsigned char *bitmap_buffer;
50 } mp_osd_obj_t;
53 #include "subreader.h"
55 extern sub_data* subdata; //currently used subtitles
56 extern subtitle* vo_sub;
58 extern unsigned char* vo_osd_text;
60 extern void* vo_osd_teletext_page;
61 extern int vo_osd_teletext_half;
62 extern int vo_osd_teletext_mode;
63 extern int vo_osd_teletext_format;
65 extern int vo_osd_progbar_type;
66 extern int vo_osd_progbar_value; // 0..255
68 extern void* vo_spudec;
69 extern void* vo_vobsub;
71 #define OSD_PLAY 0x01
72 #define OSD_PAUSE 0x02
73 #define OSD_STOP 0x03
74 #define OSD_REW 0x04
75 #define OSD_FFW 0x05
76 #define OSD_CLOCK 0x06
77 #define OSD_CONTRAST 0x07
78 #define OSD_SATURATION 0x08
79 #define OSD_VOLUME 0x09
80 #define OSD_BRIGHTNESS 0x0A
81 #define OSD_HUE 0x0B
82 #define OSD_BALANCE 0x0C
83 #define OSD_PANSCAN 0x50
85 #define OSD_PB_START 0x10
86 #define OSD_PB_0 0x11
87 #define OSD_PB_END 0x12
88 #define OSD_PB_1 0x13
90 /* now in textform */
91 extern char * sub_osd_names[];
92 extern char * sub_osd_names_short[];
94 extern int sub_unicode;
95 extern int sub_utf8;
97 extern char *sub_cp;
98 extern int sub_pos;
99 extern int sub_width_p;
100 extern int sub_alignment;
101 extern int sub_visibility;
102 extern int sub_bg_color; /* subtitles background color */
103 extern int sub_bg_alpha;
104 extern int spu_alignment;
105 extern int spu_aamode;
106 extern float spu_gaussvar;
108 void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
109 void vo_draw_text_ext(int dxs, int dys, int left_border, int top_border,
110 int right_border, int bottom_border, int orig_w, int orig_h,
111 void (*draw_alpha)(int x0, int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
112 void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h));
114 void vo_init_osd(void);
115 int vo_update_osd(int dxs,int dys);
116 int vo_osd_changed(int new_value);
117 int vo_osd_check_range_update(int,int,int,int);
118 void free_osd_list(void);
120 extern int vo_osd_changed_flag;
122 unsigned utf8_get_char(const char **str);
124 #ifdef CONFIG_DVDNAV
125 #include <inttypes.h>
126 void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey);
127 #endif
129 #endif /* MPLAYER_SUB_H */