annotate libass/ass_cache.h @ 19965:70352570e9ae

Shadow support in libass.
author eugeni
date Sun, 24 Sep 2006 16:04:37 +0000
parents 07be98a5dd5f
children fa122b7c71c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18937
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
1 #ifndef __ASS_CACHE_H__
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
2 #define __ASS_CACHE_H__
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
3
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
4 #include <ft2build.h>
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
5 #include FT_FREETYPE_H
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
6 #include FT_STROKER_H
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
7 #include FT_GLYPH_H
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
8
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
9 // font cache
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
10 typedef struct face_desc_s {
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
11 char* family;
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
12 unsigned bold;
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
13 unsigned italic;
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
14 } face_desc_t;
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
15
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
16 void ass_face_cache_init(void);
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
17 int ass_new_face(FT_Library library, void* fontconfig_priv, face_desc_t* desc, /*out*/ FT_Face* face);
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
18 void ass_face_cache_done(void);
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
19
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
20
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
21 // describes a glyph; glyphs with equivalents structs are considered identical
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
22 typedef struct glyph_hash_key_s {
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
23 char bitmap; // bool : true = bitmap, false = outline
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
24 FT_Face face;
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
25 int size; // font size
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
26 int index; // glyph index in the face
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
27 unsigned outline; // border width, 16.16 fixed point value
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
28 int bold, italic;
19848
07be98a5dd5f Add \be (blur edges) support to libass.
eugeni
parents: 19846
diff changeset
29 char be; // blur edges
18937
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
30
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
31 // the following affects bitmap glyphs only
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
32 unsigned scale_x, scale_y; // 16.16
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
33 int angle; // signed 16.16
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
34
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
35 FT_Vector advance; // subpixel shift vector
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
36 } glyph_hash_key_t;
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
37
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
38 typedef struct glyph_hash_val_s {
19846
bcc792bfa431 Store bitmap glyphs in a separate struct, instead of FreeType's internal buffer.
eugeni
parents: 19539
diff changeset
39 bitmap_t* bm; // the actual glyph bitmaps
bcc792bfa431 Store bitmap glyphs in a separate struct, instead of FreeType's internal buffer.
eugeni
parents: 19539
diff changeset
40 bitmap_t* bm_o;
19965
70352570e9ae Shadow support in libass.
eugeni
parents: 19848
diff changeset
41 bitmap_t* bm_s;
18937
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
42 FT_BBox bbox_scaled; // bbox after scaling, but before rotation
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
43 FT_Vector advance; // 26.6, advance distance to the next glyph in line
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
44 } glyph_hash_val_t;
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
45
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
46 void ass_glyph_cache_init(void);
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
47 void cache_add_glyph(glyph_hash_key_t* key, glyph_hash_val_t* val);
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
48 glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key);
19539
64009ae411fb Reset glyph cache on reconfigure.
eugeni
parents: 18937
diff changeset
49 void ass_glyph_cache_reset(void);
18937
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
50 void ass_glyph_cache_done(void);
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
51
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
52 #endif
9e95ac641e77 Initial libass release (without mencoder support).
eugeni
parents:
diff changeset
53