shop-old/libs/phImaginator/phImaginator.Flip.class.php
2026-04-20 01:03:43 +02:00

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();
}
}
?>