File: t00flines.t

package info (click to toggle)
libimager-perl 1.010%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,336 kB
  • sloc: perl: 31,479; ansic: 27,831; makefile: 55; cpp: 4
file content (38 lines) | stat: -rw-r--r-- 880 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!perl -w
use strict;
use blib;
use Imager;
use Test::More tests => 3;

BEGIN { use_ok('Imager::Filter::Flines') }

-d "testout" or mkdir "testout";

Imager->open_log(log => "testout/t00flines.log");

{
  my $im = Imager->new(xsize=>150, ysize=>150);
  
  $im->box(filled=>1, xmin => 70, ymin=>25, xmax =>130, ymax => 125, 
	   color=>'00FF00');
  $im->box(filled=>1, xmin=>20, ymin=>25, xmax=>80, ymax=>125,
	   color => '0000FF');
  $im->arc(x =>75, y=>75, r=>30, color => 'FF0000');
  $im->filter(type=>"conv", coef => [0.1, 0.2, 0.4, 0.2, 0.1]);

  ok($im->filter(type=>'flines'),
     "try filter")
    or print "# ", $im->errstr, "\n";
  ok($im->write(file => 'testout/t00flines.ppm'),
     "save result");
}

END {
  Imager->close_log;

  unless ($ENV{IMAGER_KEEP_FILES}) {
    unlink 'testout/t00flines.ppm';
    unlink "testout/t00flines.log";
    rmdir "testout";
  }
}