summaryrefslogtreecommitdiffstats
path: root/libass/ass_drawing.h
diff options
context:
space:
mode:
authorDr.Smile <vabnick@gmail.com>2017-09-17 03:00:34 +0300
committerDr.Smile <vabnick@gmail.com>2017-09-17 04:07:20 +0300
commitf159a8cf55c8b3f2193ab20159a255310c7c5ca9 (patch)
tree53da5b52088cae27897b3cb6893ef65630aea892 /libass/ass_drawing.h
parent218ee0b2ab23e3f127b77579c57e9097a5ac6056 (diff)
downloadlibass-f159a8cf55c8b3f2193ab20159a255310c7c5ca9.tar.bz2
libass-f159a8cf55c8b3f2193ab20159a255310c7c5ca9.tar.xz
Replace FreeType types with libass native types
FT_Vector and FT_BBox types are based on FT_Pos, which is alias of long. FreeType treats it as 32-bit integer, but on some platforms long can be 64-bit. That leads to wasted memory and suboptimal performance.
Diffstat (limited to 'libass/ass_drawing.h')
-rw-r--r--libass/ass_drawing.h29
1 files changed, 13 insertions, 16 deletions
diff --git a/libass/ass_drawing.h b/libass/ass_drawing.h
index 28a7040..95e361f 100644
--- a/libass/ass_drawing.h
+++ b/libass/ass_drawing.h
@@ -19,9 +19,6 @@
#ifndef LIBASS_DRAWING_H
#define LIBASS_DRAWING_H
-#include <ft2build.h>
-#include FT_OUTLINE_H
-
#include "ass.h"
#include "ass_outline.h"
#include "ass_bitmap.h"
@@ -39,7 +36,7 @@ typedef enum {
typedef struct ass_drawing_token {
ASS_TokenType type;
- FT_Vector point;
+ ASS_Vector point;
struct ass_drawing_token *next;
struct ass_drawing_token *prev;
} ASS_DrawingToken;
@@ -48,26 +45,26 @@ typedef struct {
char *text; // drawing string
int scale; // scale (1-64) for subpixel accuracy
double pbo; // drawing will be shifted in y direction by this amount
- double scale_x; // FontScaleX
- double scale_y; // FontScaleY
- int asc; // ascender
- int desc; // descender
+ double scale_x; // FontScaleX
+ double scale_y; // FontScaleY
+ int asc; // ascender
+ int desc; // descender
ASS_Outline outline; // target outline
- FT_Vector advance; // advance (from cbox)
- int hash; // hash value (for caching)
+ ASS_Vector advance; // advance (from cbox)
+ int hash; // hash value (for caching)
// private
ASS_Library *library;
ASS_DrawingToken *tokens; // tokenized drawing
double point_scale_x;
double point_scale_y;
- FT_BBox cbox; // bounding box, or let's say... VSFilter's idea of it
+ ASS_Rect cbox; // bounding box, or let's say... VSFilter's idea of it
} ASS_Drawing;
-ASS_Drawing *ass_drawing_new(ASS_Library *lib, FT_Library ftlib);
-void ass_drawing_free(ASS_Drawing* drawing);
-void ass_drawing_set_text(ASS_Drawing* drawing, char *str, size_t n);
-void ass_drawing_hash(ASS_Drawing* drawing);
-ASS_Outline *ass_drawing_parse(ASS_Drawing *drawing, int raw_mode);
+ASS_Drawing *ass_drawing_new(ASS_Library *lib);
+void ass_drawing_free(ASS_Drawing *drawing);
+void ass_drawing_set_text(ASS_Drawing *drawing, char *str, size_t n);
+void ass_drawing_hash(ASS_Drawing *drawing);
+ASS_Outline *ass_drawing_parse(ASS_Drawing *drawing, bool raw_mode);
#endif /* LIBASS_DRAWING_H */