From d2cd12a0b04ab59ed6a8ed211b2e18b62435a227 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Thu, 14 Dec 2023 18:10:01 +0100 Subject: [PATCH] [orx-integral-image, orx-poisson-fill, orx-dnk3] Match changes in Filter --- orx-integral-image/src/main/kotlin/FastIntegralImage.kt | 5 +++-- .../orx-dnk3/src/main/kotlin/post/VolumetricIrradiance.kt | 6 ++++-- orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt | 4 +++- orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonFiller.kt | 4 +++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/orx-integral-image/src/main/kotlin/FastIntegralImage.kt b/orx-integral-image/src/main/kotlin/FastIntegralImage.kt index ed8a7dd43..558f74e14 100644 --- a/orx-integral-image/src/main/kotlin/FastIntegralImage.kt +++ b/orx-integral-image/src/main/kotlin/FastIntegralImage.kt @@ -5,6 +5,7 @@ import org.openrndr.extra.fx.blend.Passthrough import org.openrndr.math.Vector2 import org.openrndr.resourceUrl +import org.openrndr.shape.Rectangle class FastIntegralImageFilter : Filter(filterShaderFromUrl(resourceUrl( @@ -38,8 +39,8 @@ class FastIntegralImage : Filter(filterShaderFromUrl(resourceUrl( return sampleCounts } - override fun apply(source: Array, target: Array) { - + override fun apply(source: Array, target: Array, clip: Rectangle?) { + require(clip == null) val sampleCountBase = 16 val xSampleCounts = sampleCounts(source[0].width, sampleCountBase) val ySampleCounts = sampleCounts(source[0].height, sampleCountBase) diff --git a/orx-jvm/orx-dnk3/src/main/kotlin/post/VolumetricIrradiance.kt b/orx-jvm/orx-dnk3/src/main/kotlin/post/VolumetricIrradiance.kt index 2c7d54c74..c6d20dbc7 100644 --- a/orx-jvm/orx-dnk3/src/main/kotlin/post/VolumetricIrradiance.kt +++ b/orx-jvm/orx-dnk3/src/main/kotlin/post/VolumetricIrradiance.kt @@ -6,6 +6,7 @@ import org.openrndr.extra.shaderphrases.preprocessShader import org.openrndr.math.IntVector3 import org.openrndr.math.Matrix44 import org.openrndr.resourceUrl +import org.openrndr.shape.Rectangle import java.net.URL fun preprocessedFilterShaderFromUrl(url: String): Shader { @@ -30,7 +31,8 @@ class VolumetricIrradiance : Filter(preprocessedFilterShaderFromUrl(resourceUrl( projectionMatrixInverse = Matrix44.IDENTITY } - override fun apply(source: Array, target: Array) { + override fun apply(source: Array, target: Array, clip: Rectangle?) { + require(clip == null) irradianceSH?.shMap?.let { parameters["shMap"] = it } @@ -39,7 +41,7 @@ class VolumetricIrradiance : Filter(preprocessedFilterShaderFromUrl(resourceUrl( parameters["shMapOffset"] = it.offset parameters["shMapSpacing"] = it.spacing } - super.apply(source, target) + super.apply(source, target, clip) } } diff --git a/orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt b/orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt index 743aced1a..9522d3f4e 100644 --- a/orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt +++ b/orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonBlender.kt @@ -6,6 +6,7 @@ import org.openrndr.extra.fx.blend.Subtract import org.openrndr.filter.color.delinearize import org.openrndr.filter.color.linearize import org.openrndr.resourceUrl +import org.openrndr.shape.Rectangle internal class BlendBoundary : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/blend-boundary.frag"))) class AlphaToBitmap : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/alpha-to-bitmap.frag"))) @@ -71,7 +72,8 @@ class PoissonBlend: Filter2to1() { val alphaToBitmap = AlphaToBitmap() var mask: ColorBuffer? = null - override fun apply(source: Array, target: Array) { + override fun apply(source: Array, target: Array, clip: Rectangle?) { + require(clip == null) if (target.isNotEmpty()) { mask?.let { diff --git a/orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonFiller.kt b/orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonFiller.kt index 2d7e5da78..e145b33ec 100644 --- a/orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonFiller.kt +++ b/orx-jvm/orx-poisson-fill/src/main/kotlin/PoissonFiller.kt @@ -2,6 +2,7 @@ package org.openrndr.poissonfill import org.openrndr.draw.* import org.openrndr.resourceUrl +import org.openrndr.shape.Rectangle internal class FillBoundary : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/fill-boundary.frag"))) internal class FillCombine : Filter(filterShaderFromUrl(resourceUrl("/shaders/gl3/poisson/fill-combine.frag"))) @@ -41,7 +42,8 @@ class PoissonFiller(val width: Int, val height: Int, type: ColorType = ColorType */ class PoissonFill : Filter1to1() { private var filler: PoissonFiller? = null - override fun apply(source: Array, target: Array) { + override fun apply(source: Array, target: Array, clip: Rectangle?) { + require(clip == null) if (target.isNotEmpty()) { filler?.let { if (it.width != target[0].effectiveWidth || it.height != target[0].effectiveHeight) {