diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-03-13 13:57:11 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-03-13 13:57:11 +0100 |
commit | 48652e529ed1c0ae23cfd45f14d9655ad2849c89 (patch) | |
tree | a34e7562a30f3a7e42070f1f5a8763f6d1d608cb /draw/draw_edge.c | |
parent | 9cbfb766564d0e80d259e3e0a919d72a75bbb6ee (diff) | |
download | mupdf-48652e529ed1c0ae23cfd45f14d9655ad2849c89.tar.xz |
Rename some functions and accessors to be more consistent.
Debug printing functions: debug -> print.
Accessors: get noun attribute -> noun attribute.
Find -> lookup when the returned value is not reference counted.
pixmap_with_rect -> pixmap_with_bbox.
We are reserving the word "find" to mean lookups that give ownership
of objects to the caller. Lookup is used in other places where the
ownership is not transferred, or simple values are returned.
The rename is done by the sed script in scripts/rename3.sed
Diffstat (limited to 'draw/draw_edge.c')
-rw-r--r-- | draw/draw_edge.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/draw/draw_edge.c b/draw/draw_edge.c index ad7a413c..12ba72fc 100644 --- a/draw/draw_edge.c +++ b/draw/draw_edge.c @@ -20,7 +20,7 @@ struct fz_aa_context_s int hscale; int vscale; int scale; - int level; + int bits; }; void fz_new_aa_context(fz_context *ctx) @@ -30,12 +30,12 @@ void fz_new_aa_context(fz_context *ctx) ctx->aa->hscale = 17; ctx->aa->vscale = 15; ctx->aa->scale = 256; - ctx->aa->level = 8; + ctx->aa->bits = 8; #define fz_aa_hscale ((ctxaa)->hscale) #define fz_aa_vscale ((ctxaa)->vscale) #define fz_aa_scale ((ctxaa)->scale) -#define fz_aa_level ((ctxaa)->level) +#define fz_aa_bits ((ctxaa)->bits) #define AA_SCALE(x) ((x * fz_aa_scale) >> 8) #endif @@ -61,40 +61,40 @@ void fz_free_aa_context(fz_context *ctx) #define AA_SCALE(x) (x) #define fz_aa_hscale 17 #define fz_aa_vscale 15 -#define fz_aa_level 8 +#define fz_aa_bits 8 #elif AA_BITS > 4 #define AA_SCALE(x) ((x * 255) >> 6) #define fz_aa_hscale 8 #define fz_aa_vscale 8 -#define fz_aa_level 6 +#define fz_aa_bits 6 #elif AA_BITS > 2 #define AA_SCALE(x) (x * 17) #define fz_aa_hscale 5 #define fz_aa_vscale 3 -#define fz_aa_level 4 +#define fz_aa_bits 4 #elif AA_BITS > 0 #define AA_SCALE(x) ((x * 255) >> 2) #define fz_aa_hscale 2 #define fz_aa_vscale 2 -#define fz_aa_level 2 +#define fz_aa_bits 2 #else #define AA_SCALE(x) (x * 255) #define fz_aa_hscale 1 #define fz_aa_vscale 1 -#define fz_aa_level 0 +#define fz_aa_bits 0 #endif #endif int -fz_get_aa_level(fz_context *ctx) +fz_aa_level(fz_context *ctx) { fz_aa_context *ctxaa = ctx->aa; - return fz_aa_level; + return fz_aa_bits; } void @@ -102,37 +102,37 @@ fz_set_aa_level(fz_context *ctx, int level) { fz_aa_context *ctxaa = ctx->aa; #ifdef AA_BITS - fz_warn(ctx, "anti-aliasing was compiled with a fixed precision of %d bits", fz_aa_level); + fz_warn(ctx, "anti-aliasing was compiled with a fixed precision of %d bits", fz_aa_bits); #else if (level > 6) { fz_aa_hscale = 17; fz_aa_vscale = 15; - fz_aa_level = 8; + fz_aa_bits = 8; } else if (level > 4) { fz_aa_hscale = 8; fz_aa_vscale = 8; - fz_aa_level = 6; + fz_aa_bits = 6; } else if (level > 2) { fz_aa_hscale = 5; fz_aa_vscale = 3; - fz_aa_level = 4; + fz_aa_bits = 4; } else if (level > 0) { fz_aa_hscale = 2; fz_aa_vscale = 2; - fz_aa_level = 2; + fz_aa_bits = 2; } else { fz_aa_hscale = 1; fz_aa_vscale = 1; - fz_aa_level = 0; + fz_aa_bits = 0; } fz_aa_scale = 0xFF00 / (fz_aa_hscale * fz_aa_vscale); #endif @@ -798,7 +798,7 @@ fz_scan_convert(fz_gel *gel, int eofill, fz_bbox clip, { fz_aa_context *ctxaa = gel->ctx->aa; - if (fz_aa_level > 0) + if (fz_aa_bits > 0) fz_scan_convert_aa(gel, eofill, clip, dst, color); else fz_scan_convert_sharp(gel, eofill, clip, dst, color); |