1--TEST--
2Test Imagick, distortImage
3--SKIPIF--
4<?php
5$imageMagickRequiredVersion=0x675;
6require_once(dirname(__FILE__) . '/skipif.inc');
7?>
8--FILE--
9<?php
10
11$distortion = 1;
12
13
14// Order     X1,Y1 I1,J1     X2,Y2 I2,J2     X3,Y3 I3,J3     X4,Y4 I4,J4 . . . .
15// The 'Order' argument is usually an integer from '1' onward, though a special value
16// of '1.5' can also be used. This defines the 'order' or complexity of the 2-dimensional
17// mathematical equation (using both 'x' and 'y') , that will be applied.
18// For example an order '1' polynomial will fit a equation of the form...
19// Xd = 	 C2x*Xs + C1x*Ys + C0x	  ,      	Yd = 	 C2y*Xs + C1y*Ys + C0y
20// See also http://www.imagemagick.org/Usage/distorts/#polynomial
21
22        $imagick = new \Imagick();
23    $imagick->newPseudoImage(640, 480, "magick:logo");
24        $points = array(
25            1.5,   //Order 1.5 = special
26            0, 0, 26, 0,
27            128,0,  114,23,
28            128,128,  128,100,
29            0,128,  0,123
30        );
31        $imagick->setimagebackgroundcolor("#fad888");
32        $imagick->setImageVirtualPixelMethod( \Imagick::VIRTUALPIXELMETHOD_BACKGROUND);
33        $imagick->distortImage(\Imagick::DISTORTION_POLYNOMIAL, $points, TRUE);
34    $bytes = $imagick;
35    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
36
37echo "Ok";
38?>
39--EXPECTF--
40Ok