- constify the Imager API
[imager.git] / Mandelbrot / Mandelbrot.pm
CommitLineData
92bda632
TC
1package Imager::Filter::Mandelbrot;
2use strict;
3use Imager;
4use vars qw($VERSION @ISA);
5
6BEGIN {
7 $VERSION = "0.01";
8
9 eval {
10 require XSLoader;
11 XSLoader::load('Imager::Filter::Mandelbrot', $VERSION);
12 1;
13 } or do {
14 require DynaLoader;
15 push @ISA, 'DynaLoader';
16 bootstrap Imager::Filter::Mandelbrot $VERSION;
17 };
18}
19
20sub _mandelbrot {
21 my %hsh = @_;
22
23 mandelbrot($hsh{image}, $hsh{minx}, $hsh{miny}, $hsh{maxx}, $hsh{maxy}, $hsh{maxiter});
24}
25
26my %defaults =
27 (
28 minx => -2.5,
29 maxx => 1.5,
30 miny => -1.5,
31 maxy => 1.5,
32 maxiter => 256,
33 );
34
35my @callseq = qw/image minx miny maxx maxy maxiter/;
36
37Imager->register_filter(type=>'mandelbrot',
38 callsub => \&_mandelbrot,
39 defaults => \%defaults,
40 callseq => \@callseq);
41
421;