When I use CannyEdgeDetector, LumaSobel, and LumaLaplacian (as well as CMYKHalftone), I see a strange grid overlay on my image when it is rendered to screen. I’m pasting my code here and a picture of what I see.
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.isolatedWithTarget
import org.openrndr.draw.renderTarget
import org.openrndr.extra.fx.edges.CannyEdgeDetector
import org.openrndr.extra.fx.edges.LumaSobel
import org.openrndr.extra.fx.edges.LumaLaplacian
import org.openrndr.ffmpeg.VideoPlayerConfiguration
import org.openrndr.ffmpeg.VideoPlayerFFMPEG
import org.openrndr.shape.Rectangle
fun main() = application {
configure {
width = 720
height = 720
windowResizable = true
}
program {
val config = VideoPlayerConfiguration()
config.displayQueueSize = 50
config.synchronizeToClock = false
val camera = VideoPlayerFFMPEG.fromDevice(configuration = config, audioDevice = null, deviceName = "/dev/video0")
camera.play()
val source = Rectangle(camera.width.toDouble() / 2.0 - camera.height.toDouble() / 2.0, 0.0, camera.height.toDouble(), camera.height.toDouble())
var rtDestination = Rectangle(0.0, 0.0, window.size.y, window.size.y)
var rt = renderTarget(window.size.x.toInt(), window.size.y.toInt()) {
colorBuffer()
}
window.sized.listen {
rt = renderTarget(window.size.x.toInt(), window.size.y.toInt()) {
colorBuffer()
}
rtDestination = Rectangle(0.0, 0.0, window.size.y, window.size.y)
}
val effect = LumaSobel()
extend {
drawer.clear(ColorRGBa.BLACK)
drawer.isolatedWithTarget(rt) {
camera.draw(drawer, source, rtDestination)
}
effect.apply(rt.colorBuffer(0), rt.colorBuffer(0))
val dim = window.size.y * 0.9
val destination = Rectangle(window.size.y / 20.0, window.size.x / 20.0, dim, dim)
drawer.image(rt.colorBuffer(0), rtDestination, destination)
}
}
}
