[cairo] cairo anti aliasing

Tim Janik timj at gtk.org
Sat Feb 26 10:03:37 PST 2005


On Fri, 18 Feb 2005, Bill Spitzak wrote:

> Tim Janik wrote:

>> adjusting the amount of anti-aliasing:
>>   currently, i can render rectangles with varying amounts of smoothness at
>>   the edges, similar to the "Feather Edge" feature of the gimp "rectangle
>>   select" command. this is essentially adjusting the radius of a 2D 
>> gaussian
>>   curve in pixels, used to smooth the figure edges.

> Also I suspect you want the blur to remain the same size when drawn on
> different devices. So even if this algorithim is used, you want the ramp
> to be 3 units wide, not 3 pixels. However for the correct "1" value you
> want 1 pixel, not 1 unit. So if there is some kind of control it either
> has to add to the base control so that 0 means normal antialiasing, or
> it would have to be non-linear, so that 0-1 are in pixels while 1-n are
> (n-1)*units+1pixel.

i'm not sure i correctly get your argument about units here.
currently, i'm using logic that attempts to preserve the feather edge
width in pixels, regardless of zoom or other transformations applied
to the rendered object.

> It may be better to describe the desired result directly. The rectangle
> on the right, including the Mach banding points, can be replicated in
> existing Cairo as a smaller white rectangle and 4 thin trapazoids drawn
> around the edges with a gradient ramp, white on the inside touching the
> rectangle and black on the outside.

that'd applicable only for this example. but i'm indeed more interested
in using the gaussian integrals as an antialiasing and rendering technique.

> More complex shapes would, I think,
> be possible with Cairo's path-enumeration, but obviously more difficult.

path enumeration? is that a planned feature exporting path shapes, or...?

---
ciaoTJ



More information about the cairo mailing list