Re: Cairo and ISO C++

Dov Grobgeld <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CA++fsGFvNhP2vG0Zrw_bXpkC58fjAhr7_n3FteJ8t6v5n04_eQ@mail.gmail.com>
Please don't even consider taking away anti-aliasing. I'm using it in [1]
and [2] in order to use the same graphical primitives for painting and for
outputting a label image (an image where the  "color" indicates a label for
the object at the pixel). Painting with antialiased graphics destroys the
ability to create the label image.

See:
[1] https://github.com/dov/dovtk-lasso
[2] https://github.com/dov/giv



On Wed, Jan 15, 2014 at 9:40 PM, Bill Spitzak <[email protected]> wrote:

> Yes it does sound like the "crisp edges" specified there, however they are
> describing an excessively complex and non-working solution.
>
> All I want is for strokes that have an odd width to be offset by .5, .5,
> the purpose being to be able to reuse the path for both a fill and stroke
> and get a sharp edge. I used the zero linewidth because every other
> graphics library I have ever seen used zero for this, and because most uses
> would like the same line no matter what the CTM is (it is often used to
> draw guidelines), and because I did not want to add another call to the
> Cairo API.
>
> You cannot adjust all the strokes to the nearest pixel because this will
> either cause identical objects to vary in size, or identical gaps between
> objects to vary in size. Both look much uglier than antialiasing. Fixing
> this would require advanced AI that replicates the human visual system to
> detect what adjustments are acceptable. And you never want to "turn off
> antialiasing" and I think it would be nice if Cairo removed this ability,
> as amateur programmers seem to think it is the solution to everything.
>
> The alternative is to provide an api that communicates accurate metrics of
> the actual area the rendered path took, similar to how font metrics are
> done. I don't think cairo wants to go there.
>
>
> Emmanuel PACAUD wrote:
>
>  The mode you describes is pretty much shape-rendering="crispEdges" in
>> the SVG world.
>>
>> https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/
>> shape-rendering
>>
>> While it would be nice to have something like that in cairo, I don't
>> think the special zero linewidth approach is interresting, as crisp
>> edges is not limited to only one pixel strokes. And I would not have
>> this mode by default.
>>
>> It would be better implemented as a mode set by a call to a
>> cairo_set_rendering_mode function, which would match the SVG model (I'm
>> not sure, but probably the PDF model too).
>>
>>         Cheers,
>>
>>                 Emmanuel.
>>
> --
> cairo mailing list
> [email protected]
> http://lists.cairographics.org/mailman/listinfo/cairo
>

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.