Summary: | cairo bitmapped (png) results do not fill self-intersecting boundaries correctly | ||
---|---|---|---|
Product: | cairo | Reporter: | Alan W. Irwin <Alan.W.Irwin1234> |
Component: | png functions | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED NOTOURBUG | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | medium | ||
Version: | 1.8.10 | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Alan W. Irwin
2011-03-03 17:01:58 UTC
I looked at the cairo trace for the fourth figure and noticed that the path is not closed. Adding some printfs to x27c shows that while the phi parameter does goes from 0 to 160*pi, the phiw goes from 0 to roughly 226.67*pi, so that's the cause of the path being open. Is this intentional? Your bug report doesn't spell it out, so could you clarify what the problem in the rendering of the fourth figure is? Thanks. > Is this (non-closed path) intentional? Good catch. I assumed all pages were closed (this example not originally programmed by me), but pages 11-13 are closed while pages 14 and above are obviously _not_ closed. For the latter pages this obviously introduces an extra large last segment in the boundary back to the starting position. I am still investigating the effect of changing the loop termination so that all figures all have a predefined last segment corresponding to some angle (which may be zero) before complete closure. More about this later. > Your bug report doesn't spell it out, so could you clarify what the problem in the rendering of the fourth figure is? Thanks. I made those comments in the X bug report I referred to, but for completeness I should state it here as well. For the even-odd filling rule (-eofill) the filled and unfilled areas in the figures should essentially alternate. Instead, for pages 11-13, no filling occurs at all (that should be impossible for these closed figures), while for pages 14 and beyond certain of the areas that should be filled are not, and vice versa. (The large last segment of the boundary must have some effect here, but the fills obviously do not alternate as they should.) For the non-zero winding number fill rule (no -eofill option), pages 11-13 are filled correctly, but for pages 14 and beyond there are asymmetries in the results on the right-hand sides of the plots (which are probably due to the large last boundary segment referred to above, but I am still investigating). So in sum, there are obvious fill errors for the even-off fill rule, while it is possible there are no fill errors for the non-zero winding number fill rule since the asymmetries you see in that case could be an artifact of the last large segment of the boundary. As of revision 11591 of PLplot svn trunk, I have changed example 27 so that the maximum phi and phiw values are the smallest possible integers times 2 pi. The previous incorrect maximum values for these numbers so complicated the boundary (with many duplicate boundaries) that correct fills were being generated that looked incorrect for the -eofill case. The incorrect maximums also caused a large last boundary segment that introduced small but noticable asymmetries into the case without -eofill. Now these example 27 issues have been fixed, the results with -eofill are not only correct but also beautiful (see, for example, revised testeo.pngcairo.19) while results without -eofill are also correct (symmetrical). Accordingly I am changing the status of the "bug" to RESOLVED/NOTOURBUG. My thanks to M Joonas Pihlaja for a strong hint that lead me to a solution for these initial extremely puzzling fill results for the self-intersecting boundary case. One final topic is could someone comment here (just to satisfy my curiosity) on what library is the source of the fill code when cairo fills the png surface before the bitmapped png file is produced? The new example images in plplot look great. (In reply to comment #3) > One final topic is could someone comment here (just to satisfy my curiosity) on > what library is the source of the fill code when cairo fills the png surface > before the bitmapped png file is produced? Cairo does that itself. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.