Prima

 view release on metacpan or  search on metacpan

pod/Prima/Drawable.pod  view on Meta::CPAN

Turns on and off antialiased drawing on all primitives, excluding
image, C<pixel>, and C<bar_alpha> calls.

It will not be possible to turn the property on if the system does not
support it. Also, monochrome images won't support it as well.

See L</"Antialiasing and alpha">.

=item arrowHead

Defines the style to paint line heads on starting or ending points used to
define a line or polygon. Is never used on closed shapes. If C<undef>, the
heads are painted with the same style as C<lineHead>

Default value: C<le::Round>. Cannot be C<undef>.

=item arrowTail

Defines the style to paint line tails on starting or ending points used to
define a line or polygon. Is never used on closed shapes. If C<undef>, the
heads are painted with the same style as C<lineTail>; if it is also C<undef>,
then the style of C<lineHead> is used.

Default value: C<undef>

=item backColor COLOR

Sets background color to the graphic context. All drawing routines
that use non-solid or transparent fill or line patterns use this property value.

=item color COLOR

Sets foreground color to the graphic context. All drawing routines
use this property value.

=item clipRect X1, Y1, X2, Y2

Selects the clipping rectangle corresponding to the physical canvas origin.
On get-call, returns the extent of the clipping area, if it is not rectangular,
or the clipping rectangle otherwise. The code

   $d-> clipRect( 1, 1, 2, 2);
   $d-> bar( 0, 0, 1, 1);

thus affects only one pixel at (1,1).

Set-call discards the previous C<::region> value.

Note: C<::clipRect> can not be used while the object is in the paint-disabled state,
its context is neither recorded nor used as a template
( see L</"Graphic context and canvas">) -- except on images.

=item fillMode INTEGER

Affects filling style of complex polygonal shapes filled by C<fillpoly>.
If C<fm::Winding>, the filled shape contains no holes; if C<fm::Alternate>, holes are present
where the shape edges cross.

C<fm::Overlay> flag can be combined with these to counter an intrinsic defect
of filled shaped both in Win32 and X11 that don't exactly follow polygon
vertices. When supplied, it overlays a polygon over the filled shape, so that
the latter falls exactly in the boundaries defined by vertices. This is
desirable when one wants the shape to be defined exactly by polygon vertices,
but is not desirable when a shape has holes in it and is connected in a way
that the polygon overlay may leave visible connection edges over them.

=for podview <img src="windings.gif">

=for html <p><img src="https://raw.githubusercontent.com/dk/Prima/master/pod/Prima/windings.gif">

Default value: C<fm::Winding|fm::Overlay>

=item fillPattern ( [ @PATTERN ] ) or ( fp::XXX ) or IMAGE

Selects 8x8 fill pattern that affects primitives that plot filled shapes:
bar(), fill_chord(), fill_ellipse(), fillpoly(), fill_sector(), floodfill().

Accepts either a C<fp::> constant or a reference to an array of 8 integers, or
an image reference. In all cases, except where the image is colored, treats 0s
in the pattern as the currently selected C<backColor>, and 1s as C<color>. When
C<rop2> is set to C<rop::NoOper>, treats 0s as fully transparent pixels.
Additionally, in the render mode respects the C<alpha> property.

Note: Drawing
over monochome bitmap or image will not respect its C<rop> on Win32.

Depending on the parameters, treats the input as follows:

=over

=item fp:: constant

There are some predefined patterns, that can be referred via C<fp::> constants:

=for podview <img src="fills.gif" cut=1>

=for html <p><img src="https://raw.githubusercontent.com/dk/Prima/master/pod/Prima/fills.gif"><!--

  fp::Empty
  fp::Solid
  fp::Line
  fp::LtSlash
  fp::Slash
  fp::BkSlash
  fp::LtBkSlash
  fp::Hatch
  fp::XHatch
  fp::Interleave
  fp::WideDot
  fp::CloseDot
  fp::SimpleDots
  fp::Borland
  fp::Parquet

=for html -->

=for podview </cut>

( the actual patterns are hardcoded in primguts.c )
The default pattern is fp::Solid.

On a get-call, does not return the C<fp::> value but the corresponding array
(see below).  If a constant value is needed to be recovered, use C<fp::builtin>
function that would return the constant from the array. There is also two
shortcut functions, C<fp::is_solid> and C<fp::is_empty> that check if the fill



( run in 1.538 second using v1.01-cache-2.11-cpan-39bf76dae61 )