import groovy.swing.j2d.*
def gr = new GraphicsRenderer()
gr.renderToFile("sample840a.png", 300, 225){
antialias("on")
rect( x: 0, y: 0, width: 300, height: 225,
borderColor: no){
texturePaint(x: 0, y: 0, file: 'sf2.jpg' )
filters {
sphereDistort(refractionIndex: 1.9,
radius:80, centreX:0.6, centreY:0.6)
}
}
}
元画像(sf2.jpg)

出力画像(sample840a.png)

動作環境
Groovy1.6.0 Beta2, JDK1.6 Update11
関連項目
Java2DとJava Image Filters(pixels)を使用して球面処理をおこなう
No comments:
Post a Comment