OSDN Git Service

brushlib basic anti-aliasing
authorMartin Renold <martinxyz@gmx.ch>
Sat, 22 Oct 2011 21:18:11 +0000 (23:18 +0200)
committerMartin Renold <martinxyz@gmx.ch>
Sat, 22 Oct 2011 21:52:38 +0000 (23:52 +0200)
commit9dfe45b415235827af9e18eb9dc47dfe550892ef
treeb419a18e4733d0c7867d6ee17dbdae66b2079018
parenta87e79d48b784642a7d75a2a3c6627e772907101
brushlib basic anti-aliasing

Automatically adjust the dab hardness to prevent aliasing.

Most current ink brushes use a low hardness to prevent aliasing, and
are only suitable (fine-tuned) for a given resolution. With this new
code, many brushes can now just set hardness to the maximum (1.0).

Some advanced ink brushes make the hardness depend on speed or pressure,
in order to get better anti-aliasing when the radius changes with
speed or pressure. This is no longer needed and should be disabled
to prevent blur.

Anti-aliasing is enabled by default for all brushes. Existing pixel
brushes and erasers that want to erase 100% and not just 99.9% will
have to disable it.

This is not the perfect anti-aliasing implementation of course; thin
strokes (with radius close to 1px and below) tend to disappear because
of the hardness implementation. This is because the math used in the
implementation is correct mainly for large dabs with high hardness.
brushlib/brush.hpp
brushlib/brushsettings.py
gui/brushsettingswindow.py