| @@ 355-372 (lines=18) @@ | ||
| 352 | * |
|
| 353 | * @author hagiwara |
|
| 354 | */ |
|
| 355 | private function imageFlop($image) |
|
| 356 | { |
|
| 357 | // 画像の幅を取得 |
|
| 358 | $w = imagesx($image); |
|
| 359 | // 画像の高さを取得 |
|
| 360 | $h = imagesy($image); |
|
| 361 | // 変換後の画像の生成(元の画像と同じサイズ) |
|
| 362 | $destImage = @imagecreatetruecolor($w,$h); |
|
| 363 | // 逆側から色を取得 |
|
| 364 | for($i=($w-1);$i>=0;$i--){ |
|
| 365 | for($j=0;$j<$h;$j++){ |
|
| 366 | $color_index = imagecolorat($image,$i,$j); |
|
| 367 | $colors = imagecolorsforindex($image,$color_index); |
|
| 368 | imagesetpixel($destImage,abs($i-$w+1),$j,imagecolorallocate($destImage,$colors["red"],$colors["green"],$colors["blue"])); |
|
| 369 | } |
|
| 370 | } |
|
| 371 | return $destImage; |
|
| 372 | } |
|
| 373 | ||
| 374 | /** |
|
| 375 | * imageFlip |
|
| @@ 382-399 (lines=18) @@ | ||
| 379 | * |
|
| 380 | * @author hagiwara |
|
| 381 | */ |
|
| 382 | private function imageFlip($image) |
|
| 383 | { |
|
| 384 | // 画像の幅を取得 |
|
| 385 | $w = imagesx($image); |
|
| 386 | // 画像の高さを取得 |
|
| 387 | $h = imagesy($image); |
|
| 388 | // 変換後の画像の生成(元の画像と同じサイズ) |
|
| 389 | $destImage = @imagecreatetruecolor($w,$h); |
|
| 390 | // 逆側から色を取得 |
|
| 391 | for($i=0;$i<$w;$i++){ |
|
| 392 | for($j=($h-1);$j>=0;$j--){ |
|
| 393 | $color_index = imagecolorat($image,$i,$j); |
|
| 394 | $colors = imagecolorsforindex($image,$color_index); |
|
| 395 | imagesetpixel($destImage,$i,abs($j-$h+1),imagecolorallocate($destImage,$colors["red"],$colors["green"],$colors["blue"])); |
|
| 396 | } |
|
| 397 | } |
|
| 398 | return $destImage; |
|
| 399 | } |
|
| 400 | ||
| 401 | ||
| 402 | /** |
|