6 eval "use Affix::Infix2Postfix; 1;"
7 or plan skip_all => "No Affix::Infix2Postfix";
13 -d "testout" or mkdir "testout";
15 Imager->open_log('log'=>'testout/t55trans.log');
17 my $img=Imager->new();
21 ok($img, "make image object")
22 or skip("can't make image object", 5);
24 ok($img->open(file=>'testimg/scale.ppm',type=>'pnm'),
26 or skip("couldn't load test image", 4);
30 my $nimg=$img->transform(xexpr=>'x',yexpr=>'y+10*sin((x+y)/10)');
31 ok($nimg, "do transformation")
32 or skip ( "warning ".$img->errstr, 1 );
34 # xopcodes=>[qw( x y Add)],yopcodes=>[qw( x y Sub)],parm=>[]
36 ok($nimg->write(type=>'pnm',file=>'testout/t55.ppm'), "save to file");
41 my $nimg=$img->transform(xexpr=>'x+0.1*y+5*sin(y/10.0+1.57)',
42 yexpr=>'y+10*sin((x+y-0.785)/10)');
43 ok($nimg, "more complex transform")
44 or skip("couldn't make image", 1);
46 ok($nimg->write(type=>'pnm',file=>'testout/t55b.ppm'), "save to file");
51 my $empty = Imager->new;
52 ok(!$empty->transform(xexpr => "x", yexpr => "y"),
53 "fail to transform an empty image");
54 is($empty->errstr, "transform: empty input image",
55 "check error message");