/
C210_Poisson_fills003.kt
46 lines (40 loc) · 1.27 KB
/
C210_Poisson_fills003.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package examples.`80_ORX`
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.loadImage
import org.openrndr.extra.compositor.*
import org.openrndr.extra.fx.color.LumaOpacity
import org.openrndr.poissonfill.PoissonBlend
import org.openrndr.poissonfill.PoissonFill
import org.openrndr.shape.Rectangle
import kotlin.math.cos
import kotlin.math.sin
fun main() {
application {
program {
val image = loadImage("data/images/cheeta.jpg")
val c = compose {
layer {
draw {
drawer.image(image)
}
}
layer {
draw {
drawer.stroke = ColorRGBa.GRAY
drawer.fill = null
drawer.strokeWeight = 40.0
drawer.circle((cos(seconds) * 0.5 + 0.5) * width, (sin(seconds * 0.5) * 0.5 + 0.5) * height, 120.0)
}
post(LumaOpacity()) {
this.backgroundLuma = 0.25
}
blend(PoissonBlend())
}
}
extend {
c.draw(drawer)
}
}
}
}