[orx-fx] Add log polar support
This commit is contained in:
@@ -6,12 +6,21 @@ 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.BooleanParameter
|
||||
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")) {
|
||||
@BooleanParameter("log polar")
|
||||
var logPolar:Boolean by parameters
|
||||
|
||||
init {
|
||||
logPolar = true
|
||||
}
|
||||
|
||||
|
||||
var bicubicFiltering = true
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
if (bicubicFiltering && source.isNotEmpty()) {
|
||||
|
||||
@@ -6,12 +6,23 @@ 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.BooleanParameter
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.Vector2Parameter
|
||||
import org.openrndr.math.Vector2
|
||||
import kotlin.math.log
|
||||
|
||||
@Description("Rectangular to polar")
|
||||
class RectangularToPolar : Filter(mppFilterShader(fx_rectangular_to_polar, "rectangular-to-polar")) {
|
||||
|
||||
@BooleanParameter("log polar")
|
||||
var logPolar:Boolean by parameters
|
||||
|
||||
init {
|
||||
logPolar = true
|
||||
}
|
||||
|
||||
|
||||
var bicubicFiltering = true
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {
|
||||
if (bicubicFiltering && source.isNotEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user