1 -d "testout" or mkdir "testout";
3 Imager::init("log"=>'testout/t68map.log');
5 use Imager qw(:all :handy);
9 my $imbase = Imager::ImgRaw::new(200,300,3);
12 @map1 = map { int($_/2) } 0..255;
13 @map2 = map { 255-int($_/2) } 0..255;
20 i_map($imbase, [ [], [], \@map1 ]);
21 print "ok ".$tst++."\n";
22 i_map($imbase, [ \@map1, \@map1, \@map1 ]);
24 print "ok ".$tst++."\n";
25 i_map($imbase, [ \@map1, \@map2, \@map3 ]);
27 print "ok ".$tst++."\n";
28 i_map($imbase, [ \@maps, \@mapl, \@map3 ]);
30 # test the highlevel interface
31 # currently this requires visual inspection of the output files
35 if ($im->read(file=>'testimg/scale.ppm')) {
36 print( ( $im->map(red=>\@map1, green=>\@map2, blue=>\@map3) ? "ok " : "not ok ").$tst++."\n" );
37 print( ( $im->map(maps=>[\@map1, [], \@map2]) ? "ok " : "not ok "). $tst++."\n");
40 die "could not load testout/scale.ppm\n";