From 875e05c13077804cdbd4b191fc48508306eafe7e Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Wed, 11 Dec 2019 21:05:27 +0100 Subject: [PATCH] Bump OPENRNDR to 0.3.37 --- build.gradle | 6 +++--- orx-integral-image/build.gradle | 3 +++ orx-integral-image/src/main/kotlin/FastIntegralImage.kt | 8 +++++--- orx-jumpflood/build.gradle | 3 +++ orx-jumpflood/src/main/kotlin/JumpFlood.kt | 5 ++++- orx-poisson-fill/build.gradle | 3 +++ orx-poisson-fill/src/main/kotlin/ConvolutionPyramid.kt | 3 ++- orx-poisson-fill/src/main/kotlin/PoissonBlender.kt | 6 +++++- orx-temporal-blur/build.gradle | 1 + orx-temporal-blur/src/main/kotlin/TemporalBlur.kt | 4 +++- 10 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 orx-integral-image/build.gradle create mode 100644 orx-jumpflood/build.gradle create mode 100644 orx-poisson-fill/build.gradle diff --git a/build.gradle b/build.gradle index 9ce07e52..46b58ab5 100644 --- a/build.gradle +++ b/build.gradle @@ -37,8 +37,8 @@ plugins { //} project.ext { - openrndrVersion = "0.3.36" - kotlinVersion = "1.3.50" + openrndrVersion = "0.3.37" + kotlinVersion = "1.3.61" spekVersion = "2.0.6" libfreenectVersion = "0.5.7-1.5.2" gsonVersion = "2.8.6" @@ -81,7 +81,7 @@ allprojects { compile "org.openrndr:openrndr-core:$openrndrVersion" compile "org.openrndr:openrndr-filter:$openrndrVersion" compile "org.openrndr:openrndr-shape:$openrndrVersion" - compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.3.0-RC2' + compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.3.2' testImplementation "org.spekframework.spek2:spek-dsl-jvm:$spekVersion" testImplementation "org.amshove.kluent:kluent:1.53" testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion" diff --git a/orx-integral-image/build.gradle b/orx-integral-image/build.gradle new file mode 100644 index 00000000..cee4a518 --- /dev/null +++ b/orx-integral-image/build.gradle @@ -0,0 +1,3 @@ +dependencies { + compile project(":orx-fx") +} \ No newline at end of file diff --git a/orx-integral-image/src/main/kotlin/FastIntegralImage.kt b/orx-integral-image/src/main/kotlin/FastIntegralImage.kt index 9aed460e..ed8a7dd4 100644 --- a/orx-integral-image/src/main/kotlin/FastIntegralImage.kt +++ b/orx-integral-image/src/main/kotlin/FastIntegralImage.kt @@ -1,7 +1,8 @@ package org.openrndr.extra.integralimage import org.openrndr.draw.* -import org.openrndr.filter.blend.passthrough +import org.openrndr.extra.fx.blend.Passthrough + import org.openrndr.math.Vector2 import org.openrndr.resourceUrl @@ -18,6 +19,7 @@ class FastIntegralImageFilter : Filter(filterShaderFromUrl(resourceUrl( class FastIntegralImage : Filter(filterShaderFromUrl(resourceUrl( "/shaders/gl3/integral-image.frag" ))) { + private val passthrough = Passthrough() var intermediate: ColorBuffer? = null val filter = FastIntegralImageFilter() @@ -55,7 +57,7 @@ class FastIntegralImage : Filter(filterShaderFromUrl(resourceUrl( filter.sampleCountBase = sampleCountBase filter.passDirection = Vector2.UNIT_X - for (pass in 0 until xSampleCounts.size) { + for (pass in xSampleCounts.indices) { filter.sampleCount = xSampleCounts[pass] filter.passIndex = pass filter.apply( if (pass == 0) source else targets[targetIndex%2], targets[(targetIndex+1)%2]) @@ -63,7 +65,7 @@ class FastIntegralImage : Filter(filterShaderFromUrl(resourceUrl( } filter.passDirection = Vector2.UNIT_Y - for (pass in 0 until ySampleCounts.size) { + for (pass in ySampleCounts.indices) { filter.sampleCount = ySampleCounts[pass] filter.passIndex = pass filter.apply( targets[targetIndex%2], targets[(targetIndex+1)%2]) diff --git a/orx-jumpflood/build.gradle b/orx-jumpflood/build.gradle new file mode 100644 index 00000000..cee4a518 --- /dev/null +++ b/orx-jumpflood/build.gradle @@ -0,0 +1,3 @@ +dependencies { + compile project(":orx-fx") +} \ No newline at end of file diff --git a/orx-jumpflood/src/main/kotlin/JumpFlood.kt b/orx-jumpflood/src/main/kotlin/JumpFlood.kt index 34323ee9..e1a5d935 100644 --- a/orx-jumpflood/src/main/kotlin/JumpFlood.kt +++ b/orx-jumpflood/src/main/kotlin/JumpFlood.kt @@ -2,7 +2,9 @@ package org.openrndr.extra.jumpfill import org.openrndr.color.ColorRGBa import org.openrndr.draw.* -import org.openrndr.filter.blend.passthrough +import org.openrndr.extra.fx.blend.Passthrough + + import org.openrndr.math.Matrix44 import org.openrndr.math.Vector2 import org.openrndr.resourceUrl @@ -37,6 +39,7 @@ private val pixelDistance by lazy { PixelDistance() } private val pixelDirection by lazy { PixelDirection() } private val contourPoints by lazy { ContourPoints() } private val threshold by lazy { Threshold() } +private val passthrough by lazy { Passthrough() } class JumpFlooder(val width: Int, val height: Int, format:ColorFormat = ColorFormat.RGB, type:ColorType = ColorType.FLOAT32) { diff --git a/orx-poisson-fill/build.gradle b/orx-poisson-fill/build.gradle new file mode 100644 index 00000000..cee4a518 --- /dev/null +++ b/orx-poisson-fill/build.gradle @@ -0,0 +1,3 @@ +dependencies { + compile project(":orx-fx") +} \ No newline at end of file diff --git a/orx-poisson-fill/src/main/kotlin/ConvolutionPyramid.kt b/orx-poisson-fill/src/main/kotlin/ConvolutionPyramid.kt index a1372c1a..20bac87b 100644 --- a/orx-poisson-fill/src/main/kotlin/ConvolutionPyramid.kt +++ b/orx-poisson-fill/src/main/kotlin/ConvolutionPyramid.kt @@ -2,7 +2,7 @@ package org.openrndr.poissonfill import org.openrndr.color.ColorRGBa import org.openrndr.draw.* -import org.openrndr.filter.blend.passthrough +import org.openrndr.extra.fx.blend.Passthrough import org.openrndr.math.IntVector2 import org.openrndr.resourceUrl import kotlin.math.ceil @@ -39,6 +39,7 @@ internal class Convolution(filterUrl: String = "/shaders/gl3/poisson/filter.frag } } +private val passthrough by lazy { Passthrough() } internal class ConvolutionPyramid(width: Int, height: Int, private val padding: Int = 0, cutOff: Int = 10000, private val downscale: Downscale = Downscale(), diff --git a/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt b/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt index c90fe4bb..09777749 100644 --- a/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt +++ b/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt @@ -1,7 +1,8 @@ package org.openrndr.poissonfill import org.openrndr.draw.* -import org.openrndr.filter.blend.subtract +import org.openrndr.extra.fx.blend.Passthrough +import org.openrndr.extra.fx.blend.Subtract import org.openrndr.resourceUrl internal class BlendBoundary : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/blend-boundary.frag"))) @@ -19,6 +20,9 @@ internal class Clamp : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/pois var maxValue: Double by parameters } +private val passthrough by lazy { Passthrough() } +private val subtract by lazy { Subtract() } + class PoissonBlender(width: Int, height: Int, type: ColorType = ColorType.FLOAT32) { private val pyramid = ConvolutionPyramid(width, height, 0, type = type) private val preprocess = colorBuffer(width, height, type = type) diff --git a/orx-temporal-blur/build.gradle b/orx-temporal-blur/build.gradle index f80365d8..2fcfea76 100644 --- a/orx-temporal-blur/build.gradle +++ b/orx-temporal-blur/build.gradle @@ -1,3 +1,4 @@ dependencies { compile project(":orx-noise") + compile project(":orx-fx") } \ No newline at end of file diff --git a/orx-temporal-blur/src/main/kotlin/TemporalBlur.kt b/orx-temporal-blur/src/main/kotlin/TemporalBlur.kt index 06ee3f40..9863c605 100644 --- a/orx-temporal-blur/src/main/kotlin/TemporalBlur.kt +++ b/orx-temporal-blur/src/main/kotlin/TemporalBlur.kt @@ -5,7 +5,7 @@ import org.openrndr.Program import org.openrndr.color.ColorRGBa import org.openrndr.draw.* import org.openrndr.extra.noise.uniformRing -import org.openrndr.filter.blend.add +import org.openrndr.extra.fx.blend.Add import org.openrndr.filter.color.delinearize import org.openrndr.filter.color.linearize import org.openrndr.math.Matrix44 @@ -13,6 +13,8 @@ import org.openrndr.math.Matrix55 import org.openrndr.math.Vector2 import org.openrndr.math.transforms.translate +private val add by lazy { Add() } + /** * Temporal blur extension. * This works best in video rendering applications as it heavily relies on rendering