diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-10-01 12:43:55 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-10-01 16:57:50 +0100 |
commit | 68e788fa455c780b83bffa33228ff3f45bebc1d1 (patch) | |
tree | 58ee20b30cf9841fc1b6055344005c546605aabf /fitz | |
parent | 3f97526e5b340300a3e16214f9109615f521e7fc (diff) | |
download | mupdf-68e788fa455c780b83bffa33228ff3f45bebc1d1.tar.xz |
Move to consistently refer to "Linear" shadings rather than "Axial" ones.
Thanks to Sebras for pointing out our schitzophrenia here.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/fitz-internal.h | 4 | ||||
-rw-r--r-- | fitz/res_shade.c | 30 |
2 files changed, 17 insertions, 17 deletions
diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index 5d94896f..b923429f 100644 --- a/fitz/fitz-internal.h +++ b/fitz/fitz-internal.h @@ -982,14 +982,14 @@ struct fz_shade_s int use_function; float function[256][FZ_MAX_COLORS + 1]; - int type; /* function, axial, radial, mesh */ + int type; /* function, linear, radial, mesh */ union { struct { int extend[2]; float coords[2][3]; /* (x,y,r) twice */ - } a_or_r; + } l_or_r; struct { int vprow; diff --git a/fitz/res_shade.c b/fitz/res_shade.c index 4bd3ad39..80acbcf8 100644 --- a/fitz/res_shade.c +++ b/fitz/res_shade.c @@ -67,7 +67,7 @@ fz_mesh_type1_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_p } /* FIXME: Nasty */ -#define HUGENUM 32000 /* how far to extend axial/radial shadings */ +#define HUGENUM 32000 /* how far to extend linear/radial shadings */ static fz_point fz_point_on_circle(fz_point p, float r, float theta) @@ -86,12 +86,12 @@ fz_mesh_type2_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_p fz_vertex e0, e1; float theta; - p0.x = shade->u.a_or_r.coords[0][0]; - p0.y = shade->u.a_or_r.coords[0][1]; + p0.x = shade->u.l_or_r.coords[0][0]; + p0.y = shade->u.l_or_r.coords[0][1]; p0 = fz_transform_point(ctm, p0); - p1.x = shade->u.a_or_r.coords[1][0]; - p1.y = shade->u.a_or_r.coords[1][1]; + p1.x = shade->u.l_or_r.coords[1][0]; + p1.y = shade->u.l_or_r.coords[1][1]; p1 = fz_transform_point(ctm, p1); theta = atan2f(p1.y - p0.y, p1.x - p0.x); @@ -109,7 +109,7 @@ fz_mesh_type2_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_p paint_quad(painter, &v0, &v2, &v3, &v1); - if (shade->u.a_or_r.extend[0]) + if (shade->u.l_or_r.extend[0]) { e0.p.x = v0.p.x - (p1.x - p0.x) * HUGENUM; e0.p.y = v0.p.y - (p1.y - p0.y) * HUGENUM; @@ -125,7 +125,7 @@ fz_mesh_type2_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_p paint_quad(painter, &e0, &v0, &v2, &e1); } - if (shade->u.a_or_r.extend[1]) + if (shade->u.l_or_r.extend[1]) { e0.p.x = v1.p.x + (p1.x - p0.x) * HUGENUM; e0.p.y = v1.p.y + (p1.y - p0.y) * HUGENUM; @@ -200,15 +200,15 @@ fz_mesh_type3_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_p fz_point e; float er, rs; - p0.x = shade->u.a_or_r.coords[0][0]; - p0.y = shade->u.a_or_r.coords[0][1]; - r0 = shade->u.a_or_r.coords[0][2]; + p0.x = shade->u.l_or_r.coords[0][0]; + p0.y = shade->u.l_or_r.coords[0][1]; + r0 = shade->u.l_or_r.coords[0][2]; - p1.x = shade->u.a_or_r.coords[1][0]; - p1.y = shade->u.a_or_r.coords[1][1]; - r1 = shade->u.a_or_r.coords[1][2]; + p1.x = shade->u.l_or_r.coords[1][0]; + p1.y = shade->u.l_or_r.coords[1][1]; + r1 = shade->u.l_or_r.coords[1][2]; - if (shade->u.a_or_r.extend[0]) + if (shade->u.l_or_r.extend[0]) { if (r0 < r1) rs = r0 / (r0 - r1); @@ -224,7 +224,7 @@ fz_mesh_type3_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_p fz_paint_annulus(ctm, p0, r0, 0, p1, r1, 1, painter); - if (shade->u.a_or_r.extend[1]) + if (shade->u.l_or_r.extend[1]) { if (r0 > r1) rs = r1 / (r1 - r0); |