]> git.imager.perl.org - imager.git/blob - Flines/t/t00flines.t
prefer static first
[imager.git] / Flines / t / t00flines.t
1 #!perl -w
2 use strict;
3 use blib;
4 use Imager;
5 use Test::More tests => 3;
6
7 BEGIN { use_ok('Imager::Filter::Flines') }
8
9 -d "testout" or mkdir "testout";
10
11 Imager->open_log(log => "testout/t00flines.log");
12
13 {
14   my $im = Imager->new(xsize=>150, ysize=>150);
15   
16   $im->box(filled=>1, xmin => 70, ymin=>25, xmax =>130, ymax => 125, 
17            color=>'00FF00');
18   $im->box(filled=>1, xmin=>20, ymin=>25, xmax=>80, ymax=>125,
19            color => '0000FF');
20   $im->arc(x =>75, y=>75, r=>30, color => 'FF0000');
21   $im->filter(type=>"conv", coef => [0.1, 0.2, 0.4, 0.2, 0.1]);
22
23   ok($im->filter(type=>'flines'),
24      "try filter")
25     or print "# ", $im->errstr, "\n";
26   ok($im->write(file => 'testout/t00flines.ppm'),
27      "save result");
28 }
29
30 END {
31   Imager->close_log;
32
33   unless ($ENV{IMAGER_KEEP_FILES}) {
34     unlink 'testout/t00flines.ppm';
35     unlink "testout/t00flines.log";
36     rmdir "testout";
37   }
38 }