Re: A Question
Bill Spitzak <[email protected]> Tue, 26 Feb 2019 11:15:38 -0800
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAL-8oAgP5dyw+igN-LzK5svvyNyqa6cewL97g6dxJD04weQKng@mail.gmail.com> |
--===============0339300913== Content-Type: multipart/alternative; boundary="0000000000008dd26d0582d0e200" --0000000000008dd26d0582d0e200 Content-Type: text/plain; charset="UTF-8" The above answers are being a bit complex. The real answer is: Cairo is absolutely designed so that non-integer line widths and/or line positions work. It will attempt to simulate the result as best it can using anti-aliasing (ie drawing some pixels not fully opaque). The complexity in the answer is due to two things: 1. this is impossible to do perfectly if intermediate data only consists of one value for each pixel. 2: there are bugs and/or sub-optimal implementations in Cairo. On Tue, Feb 26, 2019 at 9:41 AM Bryce Harrington <[email protected]> wrote: > On Fri, Feb 22, 2019 at 04:59:43PM -0800, Thomas Dineen wrote: > > Gentle People: > > > > A question on Cairo: The X Y inputs to Cairo drawing functions are > type > > double. > > > > Dose this imply that pixel or line spacing could be less than 1.0? > > > > Could the spacing be say 0.5 or 0.25? > > Cairo does track the decimal positioning, although beware there is some > culling behavior that can kick in when you're < 1.0, that could make > things disappear unexpectedly. I don't think the documentation goes > into the culling rules in much depth, and there may be some > inconsistencies in how it's handled so may be down to experimentation > and/or code study. > > There's a FAQ item that's about a slightly different issue but might be > of interest: > > https://www.cairographics.org/FAQ/#sharp_lines > > HTH, > Bryce > -- > cairo mailing list > [email protected] > https://lists.cairographics.org/mailman/listinfo/cairo --0000000000008dd26d0582d0e200 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">The above answers are being a bit complex.<div><br></div><= div>The real answer is: Cairo is absolutely designed so that non-integer li= ne widths and/or line positions work.</div><div><br></div><div>It will atte= mpt to simulate the result as best it can using anti-aliasing (ie drawing s= ome pixels not fully opaque).</div><div><br></div><div>The complexity in th= e answer is due to two things: 1. this is impossible to do perfectly if int= ermediate data only consists of one value for each pixel. 2: there are bugs= and/or sub-optimal implementations in Cairo.</div><div><br></div><div><br>= </div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_= attr">On Tue, Feb 26, 2019 at 9:41 AM Bryce Harrington <<a href=3D"mailt= o:[email protected]">[email protected]</a>> wrote:<br></= div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor= der-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Feb 22, 2019 = at 04:59:43PM -0800, Thomas Dineen wrote:<br> > Gentle People:<br> > <br> > =C2=A0=C2=A0 A question on Cairo: The X Y inputs to Cairo drawing func= tions are type<br> > double.<br> > <br> > Dose this imply that pixel or line spacing could be less than 1.0?<br> > <br> > Could the spacing be say 0.5 or 0.25?<br> <br> Cairo does track the decimal positioning, although beware there is some<br> culling behavior that can kick in when you're < 1.0, that could make= <br> things disappear unexpectedly.=C2=A0 I don't think the documentation go= es<br> into the culling rules in much depth, and there may be some<br> inconsistencies in how it's handled so may be down to experimentation<b= r> and/or code study.<br> <br> There's a FAQ item that's about a slightly different issue but migh= t be<br> of interest:<br> <br> =C2=A0 <a href=3D"https://www.cairographics.org/FAQ/#sharp_lines" rel=3D"no= referrer" target=3D"_blank">https://www.cairographics.org/FAQ/#sharp_lines<= /a><br> <br> HTH,<br> Bryce<br> -- <br> cairo mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">cairo@cairogra= phics.org</a><br> <a href=3D"https://lists.cairographics.org/mailman/listinfo/cairo" rel=3D"n= oreferrer" target=3D"_blank">https://lists.cairographics.org/mailman/listin= fo/cairo</a></blockquote></div> --0000000000008dd26d0582d0e200-- --===============0339300913== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline LS0gCmNhaXJvIG1haWxpbmcgbGlzdApjYWlyb0BjYWlyb2dyYXBoaWNzLm9yZwpodHRwczovL2xp c3RzLmNhaXJvZ3JhcGhpY3Mub3JnL21haWxtYW4vbGlzdGluZm8vY2Fpcm8= --===============0339300913==--