[gs-devel] RE: [gs-code-review] RE: Radial shading regressions
Jeong Hee Kim
jeong at artifex.com
Sat May 25 09:38:07 PDT 2002
It is just reminding post.
Now can I commit the code ?
Jeong
> -----Original Message-----
> From: gs-code-review-admin at ghostscript.com
> [mailto:gs-code-review-admin at ghostscript.com]On Behalf Of Jeong Hee Kim
> Sent: Thursday, May 09, 2002 1:53 PM
> To: Jack Moffitt
> Cc: gs-code-review at ghostscript.com
> Subject: [gs-code-review] RE: Radial shading regressions
>
>
> Jack,
>
> I have found that there were problems when a radius of circle is 0.
> I fixed it and confirmed that there are no difference between the output
> from GS7.04 and the fixed one with 442-01.ps and 483-01.ps.
> But was there any regression problem with 245-01 ?
> I think there was no problem with 245-01.
>
> Following is the diff.
>
> Thank you.
> Jeong
>
> Index: gxshade1.c
> ===================================================================
> RCS file: /cvs/ghostscript/gs/src/gxshade1.c,v
> retrieving revision 1.14
> diff -r1.14 gxshade1.c
> 748,749c748,771
> < * For differnt radii, compute the coords for /Extend
> < * r0 must be greater than r1
> ---
> > * For differnt radii, compute the coords for /Extend option.
> > * r0 MUST be greater than r1.
> > *
> > * The extension is an area which is bounded by the two exterior common
> > * tangent of the given circles except the area between the circles.
> > *
> > * Therefore we can make the extension with the contact points between
> > * the tangent lines and circles, and the intersection point of
> > * the lines (Note that r0 is greater than r1, therefore the
> exterior common
> > * tangent for the two circles always intersect at one point.
> > * (The case when both radii are same is handled by
> 'R_compute_extension_bar')
> > *
> > * A brief algorithm is following.
> > *
> > * Let C0, C1 be the given circle with r0, r1 as radii.
> > * There exist two contact points for each circles and
> > * say them p0, p1 for C0 and q0, q1 for C1.
> > *
> > * First we compute the intersection point of both tangent
> lines (isecx, isecy).
> > * Then we get the angle between a tangent line and the line
> which penentrates
> > * the centers of circles.
> > *
> > * Then we can compute 4 contact points between two tangent
> lines and two circles,
> > * and 2 points outside the cliping area on the tangent lines.
> 750a773
> >
> 757,759c780,783
> < floatp dis;
> < floatp cir_dis;
> < floatp k;
> ---
> > floatp dist_c0_isec;
> > floatp dist_c1_isec;
> > floatp dist_p0_isec;
> > floatp dist_q0_isec;
> 761d784
> < floatp l;
> 764,770c787,788
> < coord[0][0] = isecx = (x1-x0)*r0 / (r0-r1) + x0;
> < coord[0][1] = isecy = (y1-y0)*r0 / (r0-r1) + y0;
> <
> < dis = hypot(x1-isecx, y1-isecy);
> < k = sqrt(dis*dis-r1*r1);
> < cost = k / dis;
> < sint = r1 / dis;
> ---
> > isecx = (x1-x0)*r0 / (r0-r1) + x0;
> > isecy = (y1-y0)*r0 / (r0-r1) + y0;
> 772,773c790,795
> < cir_dis = hypot(x1-x0, y1-y0);
> < l = sqrt(cir_dis*cir_dis - (r0-r1)*(r0-r1));
> ---
> > dist_c0_isec = hypot(x0-isecx, y0-isecy);
> > dist_c1_isec = hypot(x1-isecx, y1-isecy);
> > dist_p0_isec = sqrt(dist_c0_isec*dist_c0_isec - r0*r0);
> > dist_q0_isec = sqrt(dist_c1_isec*dist_c1_isec - r1*r1);
> > cost = dist_p0_isec / dist_c0_isec;
> > sint = r0 / dist_c0_isec;
> 775,776c797,798
> < dx0 = ((x1-isecx)*cost - (y1-isecy)*sint) / dis;
> < dy0 = ((x1-isecx)*sint + (y1-isecy)*cost) / dis;
> ---
> > dx0 = ((x0-isecx)*cost - (y0-isecy)*sint) / dist_c0_isec;
> > dy0 = ((x0-isecx)*sint + (y0-isecy)*cost) / dist_c0_isec;
> 778,779c800,801
> < dx1 = ((x1-isecx)*cost - (y1-isecy)*sint) / dis;
> < dy1 = ((x1-isecx)*sint + (y1-isecy)*cost) / dis;
> ---
> > dx1 = ((x0-isecx)*cost - (y0-isecy)*sint) / dist_c0_isec;
> > dy1 = ((x0-isecx)*sint + (y0-isecy)*cost) / dist_c0_isec;
> 781,784c803,808
> < coord[1][0] = isecx + dx0 * k;
> < coord[1][1] = isecy + dy0 * k;
> < coord[2][0] = isecx + dx1 * k;
> < coord[2][1] = isecy + dy1 * k;
> ---
> > coord[0][0] = isecx;
> > coord[0][1] = isecy;
> > coord[1][0] = isecx + dx0 * dist_q0_isec;
> > coord[1][1] = isecy + dy0 * dist_q0_isec;
> > coord[2][0] = isecx + dx1 * dist_q0_isec;
> > coord[2][1] = isecy + dy1 * dist_q0_isec;
> 786,787c810,811
> < coord[3][0] = isecx + dx0 * (l+k);
> < coord[3][1] = isecy + dy0 * (l+k);
> ---
> > coord[3][0] = isecx + dx0 * dist_p0_isec;
> > coord[3][1] = isecy + dy0 * dist_p0_isec;
> 790,791c814,815
> < coord[5][0] = isecx + dx1 * (l+k);
> < coord[5][1] = isecy + dy1 * (l+k);
> ---
> > coord[5][0] = isecx + dx1 * dist_p0_isec;
> > coord[5][1] = isecy + dy1 * dist_p0_isec;
>
>
>
> > -----Original Message-----
> > From: Jack Moffitt [mailto:jack at artifex.com]
> > Sent: Thursday, May 09, 2002 2:56 AM
> > To: Jeong Hee Kim
> > Cc: gs-devel at ghostscript.com
> > Subject: Radial shading regressions
> >
> >
> > Jeong,
> >
> > Our nightly regression found 3 files that failed after your radial
> > shading patch. We'd appreciate it if you could investigate these errors
> > and see if there was a bug in your patch.
> >
> > The files were 245-01.ps, 442-01.ps, and 483-01.ps, all available in
> > on casper in /home/regression/comparefiles.
> >
> > Thanks,
> > jack.
>
> _______________________________________________
> gs-code-review mailing list
> gs-code-review at ghostscript.com
> http://www.ghostscript.com/mailman/listinfo/gs-code-review
>
More information about the gs-devel
mailing list