summaryrefslogtreecommitdiffstats
path: root/libass/ass_bitmap.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-08-06 13:04:20 +0200
committerGrigori Goronzy <greg@blackbox>2009-08-06 13:15:17 +0200
commit892423a588aea8fb14e84bdb9527df97e945ec57 (patch)
treeca98694d710a7b276b79e278fe06579736a5cdc9 /libass/ass_bitmap.c
parent5ddad362f52080c4f2a46e78fc4cca4f8ca6a2b0 (diff)
downloadlibass-892423a588aea8fb14e84bdb9527df97e945ec57.tar.bz2
libass-892423a588aea8fb14e84bdb9527df97e945ec57.tar.xz
Rename typedefs (breaks API)
Rename all typedefs from the convention foo_bar_t, which can possibly conflict with POSIX types, to FooBar (and ASS_FooBar for public API typedefs). Fix formatting and stray comments while at it.
Diffstat (limited to 'libass/ass_bitmap.c')
-rw-r--r--libass/ass_bitmap.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c
index 39c4996..faddcf3 100644
--- a/libass/ass_bitmap.c
+++ b/libass/ass_bitmap.c
@@ -44,7 +44,7 @@ struct ass_synth_priv {
static const unsigned int maxcolor = 255;
static const unsigned base = 256;
-static int generate_tables(ass_synth_priv_t *priv, double radius)
+static int generate_tables(ASS_SynthPriv *priv, double radius)
{
double A = log(1.0 / base) / (radius * radius * 2);
int mx, i;
@@ -101,7 +101,7 @@ static int generate_tables(ass_synth_priv_t *priv, double radius)
return 0;
}
-static void resize_tmp(ass_synth_priv_t *priv, int w, int h)
+static void resize_tmp(ASS_SynthPriv *priv, int w, int h)
{
if (priv->tmp_w >= w && priv->tmp_h >= h)
return;
@@ -118,14 +118,14 @@ static void resize_tmp(ass_synth_priv_t *priv, int w, int h)
priv->tmp = malloc((priv->tmp_w + 1) * priv->tmp_h * sizeof(short));
}
-ass_synth_priv_t *ass_synth_init(double radius)
+ASS_SynthPriv *ass_synth_init(double radius)
{
- ass_synth_priv_t *priv = calloc(1, sizeof(ass_synth_priv_t));
+ ASS_SynthPriv *priv = calloc(1, sizeof(ASS_SynthPriv));
generate_tables(priv, radius);
return priv;
}
-void ass_synth_done(ass_synth_priv_t *priv)
+void ass_synth_done(ASS_SynthPriv *priv)
{
if (priv->tmp)
free(priv->tmp);
@@ -136,10 +136,10 @@ void ass_synth_done(ass_synth_priv_t *priv)
free(priv);
}
-static bitmap_t *alloc_bitmap(int w, int h)
+static Bitmap *alloc_bitmap(int w, int h)
{
- bitmap_t *bm;
- bm = calloc(1, sizeof(bitmap_t));
+ Bitmap *bm;
+ bm = calloc(1, sizeof(Bitmap));
bm->buffer = malloc(w * h);
bm->w = w;
bm->h = h;
@@ -147,7 +147,7 @@ static bitmap_t *alloc_bitmap(int w, int h)
return bm;
}
-void ass_free_bitmap(bitmap_t *bm)
+void ass_free_bitmap(Bitmap *bm)
{
if (bm) {
if (bm->buffer)
@@ -156,16 +156,16 @@ void ass_free_bitmap(bitmap_t *bm)
}
}
-static bitmap_t *copy_bitmap(const bitmap_t *src)
+static Bitmap *copy_bitmap(const Bitmap *src)
{
- bitmap_t *dst = alloc_bitmap(src->w, src->h);
+ Bitmap *dst = alloc_bitmap(src->w, src->h);
dst->left = src->left;
dst->top = src->top;
memcpy(dst->buffer, src->buffer, src->w * src->h);
return dst;
}
-static int check_glyph_area(ass_library_t *library, FT_Glyph glyph)
+static int check_glyph_area(ASS_Library *library, FT_Glyph glyph)
{
FT_BBox bbox;
long long dx, dy;
@@ -180,12 +180,12 @@ static int check_glyph_area(ass_library_t *library, FT_Glyph glyph)
return 0;
}
-static bitmap_t *glyph_to_bitmap_internal(ass_library_t *library,
+static Bitmap *glyph_to_bitmap_internal(ASS_Library *library,
FT_Glyph glyph, int bord)
{
FT_BitmapGlyph bg;
FT_Bitmap *bit;
- bitmap_t *bm;
+ Bitmap *bm;
int w, h;
unsigned char *src;
unsigned char *dst;
@@ -235,7 +235,7 @@ static bitmap_t *glyph_to_bitmap_internal(ass_library_t *library,
* 1. Glyph bitmap is subtracted from outline bitmap. This way looks much better in some cases.
* 2. Shadow bitmap is created as a sum of glyph and outline bitmaps.
*/
-static bitmap_t *fix_outline_and_shadow(bitmap_t *bm_g, bitmap_t *bm_o)
+static Bitmap *fix_outline_and_shadow(Bitmap *bm_g, Bitmap *bm_o)
{
int x, y;
const int l = bm_o->left > bm_g->left ? bm_o->left : bm_g->left;
@@ -247,7 +247,7 @@ static bitmap_t *fix_outline_and_shadow(bitmap_t *bm_g, bitmap_t *bm_o)
bm_o->top + bm_o->h <
bm_g->top + bm_g->h ? bm_o->top + bm_o->h : bm_g->top + bm_g->h;
- bitmap_t *bm_s = copy_bitmap(bm_o);
+ Bitmap *bm_s = copy_bitmap(bm_o);
unsigned char *g =
bm_g->buffer + (t - bm_g->top) * bm_g->w + (l - bm_g->left);
@@ -472,9 +472,9 @@ static void be_blur(unsigned char *buf, int w, int h)
}
}
-int glyph_to_bitmap(ass_library_t *library, ass_synth_priv_t *priv_blur,
+int glyph_to_bitmap(ASS_Library *library, ASS_SynthPriv *priv_blur,
FT_Glyph glyph, FT_Glyph outline_glyph,
- bitmap_t **bm_g, bitmap_t **bm_o, bitmap_t **bm_s,
+ Bitmap **bm_g, Bitmap **bm_o, Bitmap **bm_s,
int be, double blur_radius, FT_Vector shadow_offset)
{
blur_radius *= 2;