写真を半分に「カット」して、両側を水平に反転しようとしています。以下のリンクを参照してください。
原画:
出力が必要なもの:
私が得ているもの
これは私が持っているものですが、画像を水平に反転するだけです
def mirrorHorizontal(picture):
mirrorPoint = getHeight(picture)/2
height = getHeight(picture)
for x in range(0, getWidth(picture)):
for y in range(0, mirrorPoint):
topPixel = getPixel(picture, x, y)
bottomPixel = getPixel(picture, x, height - y - 1)
color = getColor(topPixel)
setColor(bottomPixel, color)
では、2 番目の写真のように見えるように、各面を水平に反転するにはどうすればよいでしょうか。