--TEST--
Test Imagick, clutImage
--SKIPIF--
<?php
$imageMagickRequiredVersion=0x675;
require_once(dirname(__FILE__) . '/skipif.inc'); 
?>
--FILE--
<?php

$draw = new \ImagickDraw();
$draw->setStrokeOpacity(0);
$draw->setFillColor('black');
$points = [
	['x' => 40 * 3, 'y' => 10 * 5],
	['x' => 20 * 3, 'y' => 20 * 5],
	['x' => 70 * 3, 'y' => 50 * 5],
	['x' => 80 * 3, 'y' => 15 * 5],
];
$draw->polygon($points);
$imagick = new \Imagick();

$imagick->setColorspace(\Imagick::COLORSPACE_GRAY);

$imagick->newPseudoImage(
	300, 300,
	"xc:white"
);

$imagick->drawImage($draw);
$imagick->blurImage(0, 10);

$draw = new \ImagickDraw();
$draw->setStrokeOpacity(1);
$draw->setFillColor('red');
$draw->point(0, 2);
$draw->setFillColor('yellow');
$draw->rectangle(0, 0, 1, 1);
$gradient = new Imagick();
$gradient->newPseudoImage(1, 5, 'xc:black');
$gradient->drawImage($draw);
$gradient->setImageFormat('png');



$imagick->setImageFormat('png');

// This test is for IM < 7 so setInterpolate not available
// Which probably means the clutImage method isn't usuable...
//$imagick->setInterpolateMethod(Imagick::INTERPOLATE_BILINEAR);
$imagick->clutImage($gradient);

$bytes = $imagick->getImageBlob();
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}


echo "Ok";
?>
--EXPECTF--
Ok