The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Prima::Drawable::Antialias - alternative API for antialiased shapes

DESCRIPTION

Prima offers drawing antialiased lines and shapes, which is rather slow but provides better visual feedback.

The module augments the Prima::Drawable drawing functionality by adding the new_aa_surface function, which features two plotting methods, polyline and fillpoly, identical to the ones in Prima::Drawable.

The emulation method in the module used to be the backend and the only implementation of antialiased shapes, but as Prima now supports that internally, this module is not used anymore. It is still functional though and can be used as an alternative.

SYNOPSIS

        $canvas-> new_aa_surface-> polyline([0, 0, 100, 100]);

        $canvas-> new_path(subpixel => 1)-> ellipse(100,100,100)->fill;

API

Methods

new $CANVAS

Creates a new AA surface object. The object is cheap to keep and reuse.

fillpoly $POLY [ $FILLMODE ]

Paints an antialiased polygon shape. The following properties from the $CANVAS are respected: color, backColor, fillPattern, fillPatternOffset, rop2.

polyline $POLY

Plots an antialiased polyline. The following properties from the $CANVAS are respected: color, backColor, linePattern, lineWidth, lineEnd, lineJoin, miterLimit, rop2

AUTHOR

Dmitry Karasik, <dmitry@karasik.eu.org>.

SEE ALSO

Prima::Drawable, examples/antialias.pl