[orx-fx] Add PolarToRectangular, RectangularToPolar and LineBlur
This commit is contained in:
23
orx-fx/src/commonMain/kotlin/distort/PolarToRectangular.kt
Normal file
23
orx-fx/src/commonMain/kotlin/distort/PolarToRectangular.kt
Normal file
@@ -0,0 +1,23 @@
|
||||
package org.openrndr.extra.fx.distort
|
||||
|
||||
import org.openrndr.draw.ColorBuffer
|
||||
import org.openrndr.draw.Filter
|
||||
import org.openrndr.draw.MagnifyingFilter
|
||||
import org.openrndr.draw.MinifyingFilter
|
||||
import org.openrndr.extra.fx.fx_polar_to_rectangular
|
||||
import org.openrndr.extra.fx.mppFilterShader
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.Vector2Parameter
|
||||
import org.openrndr.math.Vector2
|
||||
|
||||
@Description("Polar to rectangular")
|
||||
class PolarToRectangular : Filter(mppFilterShader(fx_polar_to_rectangular, "polar-to-rectangular")) {
|
||||
var bicubicFiltering = true
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
if (bicubicFiltering && source.isNotEmpty()) {
|
||||
source[0].generateMipmaps()
|
||||
source[0].filter(MinifyingFilter.LINEAR_MIPMAP_LINEAR, MagnifyingFilter.LINEAR)
|
||||
}
|
||||
super.apply(source, target)
|
||||
}
|
||||
}
|
||||
23
orx-fx/src/commonMain/kotlin/distort/RectangularToPolar.kt
Normal file
23
orx-fx/src/commonMain/kotlin/distort/RectangularToPolar.kt
Normal file
@@ -0,0 +1,23 @@
|
||||
package org.openrndr.extra.fx.distort
|
||||
|
||||
import org.openrndr.draw.ColorBuffer
|
||||
import org.openrndr.draw.Filter
|
||||
import org.openrndr.draw.MagnifyingFilter
|
||||
import org.openrndr.draw.MinifyingFilter
|
||||
import org.openrndr.extra.fx.fx_rectangular_to_polar
|
||||
import org.openrndr.extra.fx.mppFilterShader
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.Vector2Parameter
|
||||
import org.openrndr.math.Vector2
|
||||
|
||||
@Description("Rectangular to polar")
|
||||
class RectangularToPolar : Filter(mppFilterShader(fx_rectangular_to_polar, "rectangular-to-polar")) {
|
||||
var bicubicFiltering = true
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
if (bicubicFiltering && source.isNotEmpty()) {
|
||||
source[0].generateMipmaps()
|
||||
source[0].filter(MinifyingFilter.LINEAR_MIPMAP_LINEAR, MagnifyingFilter.LINEAR)
|
||||
}
|
||||
super.apply(source, target)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user