47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?php
|
|
|
|
|
|
abstract class phImaginator_Flip extends phImaginator_Universal implements phImaginator_Module {
|
|
|
|
protected static $runCollected = false;
|
|
|
|
|
|
public static function horizontal() {
|
|
$image_data =& parent::getCurrentResource();
|
|
|
|
$image = imagecreatetruecolor($image_data['width'], $image_data['height']);
|
|
imagealphablending($image, false);
|
|
imagesavealpha($image, true);
|
|
|
|
imagecopyresampled($image, $image_data['resource'], 0, 0, 0, $image_data['height'] - 1, $image_data['width'], $image_data['height'], $image_data['width'], -$image_data['height']);
|
|
|
|
$image_data['resource'] = $image;
|
|
}
|
|
|
|
|
|
public static function vertical() {
|
|
$image_data =& parent::getCurrentResource();
|
|
|
|
$image = imagecreatetruecolor($image_data['width'], $image_data['height']);
|
|
imagealphablending($image, false);
|
|
imagesavealpha($image, true);
|
|
|
|
imagecopyresampled($image, $image_data['resource'], 0, 0, $image_data['width'] - 1, 0, $image_data['width'], $image_data['height'], -$image_data['width'], $image_data['height']);
|
|
|
|
$image_data['resource'] = $image;
|
|
}
|
|
|
|
|
|
public static function both() {
|
|
self::horizontal();
|
|
self::vertical();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|