| 1 | package Imager::Filter::Mandelbrot; | ||
| 2 | 1 | ▶ | use 5.006; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use Imager; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | our $VERSION = "0.06"; | |
| 8 | |||
| 9 | 1 | require XSLoader; | |
| 10 | 1 | XSLoader::load('Imager::Filter::Mandelbrot', $VERSION); | |
| 11 | } | ||
| 12 | |||
| 13 | 1 | ▶ | sub _mandelbrot { |
|
Subroutine
_mandelbrot: called CC=1 SCAR=0.0
| |||
| 14 | 1 | my %hsh = @_; | |
| 15 | |||
| 16 | 1 | mandelbrot($hsh{image}, $hsh{minx}, $hsh{miny}, $hsh{maxx}, $hsh{maxy}, $hsh{maxiter}); | |
| 17 | } | ||
| 18 | |||
| 19 | 1 | my %defaults = | |
| 20 | ( | ||
| 21 | minx => -2.5, | ||
| 22 | maxx => 1.5, | ||
| 23 | miny => -1.5, | ||
| 24 | maxy => 1.5, | ||
| 25 | maxiter => 256, | ||
| 26 | ); | ||
| 27 | |||
| 28 | 1 | my @callseq = qw/image minx miny maxx maxy maxiter/; | |
| 29 | |||
| 30 | 1 | Imager->register_filter(type=>'mandelbrot', | |
| 31 | callsub => \&_mandelbrot, | ||
| 32 | defaults => \%defaults, | ||
| 33 | callseq => \@callseq); | ||
| 34 | |||
| 35 | 1 | 1; | |
| 36 | |||
| 37 | __END__ | ||