[orx-fx] convert to MPP
This commit is contained in:
21
orx-fx/src/commonMain/kotlin/dither/ADither.kt
Normal file
21
orx-fx/src/commonMain/kotlin/dither/ADither.kt
Normal file
@@ -0,0 +1,21 @@
|
||||
package org.openrndr.extra.fx.dither
|
||||
|
||||
import org.openrndr.draw.Filter
|
||||
import org.openrndr.extra.fx.fx_a_dither
|
||||
import org.openrndr.extra.fx.mppFilterShader
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.IntParameter
|
||||
|
||||
@Description("ADither")
|
||||
class ADither: Filter(mppFilterShader(fx_a_dither, "a-dither")) {
|
||||
@IntParameter("pattern index", 0, 3)
|
||||
var pattern: Int by parameters
|
||||
|
||||
@IntParameter("levels", 1, 64)
|
||||
var levels: Int by parameters
|
||||
|
||||
init {
|
||||
levels = 4
|
||||
pattern = 3
|
||||
}
|
||||
}
|
||||
25
orx-fx/src/commonMain/kotlin/dither/CMYKHalftone.kt
Normal file
25
orx-fx/src/commonMain/kotlin/dither/CMYKHalftone.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
package org.openrndr.extra.fx.dither
|
||||
|
||||
import org.openrndr.draw.Filter
|
||||
import org.openrndr.extra.fx.fx_cmyk_halftone
|
||||
import org.openrndr.extra.fx.mppFilterShader
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.DoubleParameter
|
||||
|
||||
@Description("CMYK Halftone")
|
||||
class CMYKHalftone: Filter(mppFilterShader(fx_cmyk_halftone, "cmyk-halftone")) {
|
||||
@DoubleParameter("scale", 1.0, 30.0, precision = 4)
|
||||
var scale: Double by parameters
|
||||
|
||||
@DoubleParameter("dotSize", 1.0, 3.0, precision = 4)
|
||||
var dotSize: Double by parameters
|
||||
|
||||
@DoubleParameter("rotation", -180.0, 180.0)
|
||||
var rotation: Double by parameters
|
||||
|
||||
init {
|
||||
scale = 3.0
|
||||
rotation = 0.0
|
||||
dotSize = 1.0
|
||||
}
|
||||
}
|
||||
29
orx-fx/src/commonMain/kotlin/dither/Crosshatch.kt
Normal file
29
orx-fx/src/commonMain/kotlin/dither/Crosshatch.kt
Normal file
@@ -0,0 +1,29 @@
|
||||
package org.openrndr.extra.fx.dither
|
||||
|
||||
import org.openrndr.draw.Filter
|
||||
import org.openrndr.extra.fx.fx_crosshatch
|
||||
import org.openrndr.extra.fx.mppFilterShader
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.DoubleParameter
|
||||
|
||||
@Description("Crosshatch")
|
||||
class Crosshatch : Filter(mppFilterShader(fx_crosshatch, "crosshatch")) {
|
||||
@DoubleParameter("threshold 1", 0.0, 1.0)
|
||||
var t1: Double by parameters
|
||||
|
||||
@DoubleParameter("threshold 2", 0.0, 1.0)
|
||||
var t2: Double by parameters
|
||||
|
||||
@DoubleParameter("threshold 3", 0.0, 1.0)
|
||||
var t3: Double by parameters
|
||||
|
||||
@DoubleParameter("threshold 4", 0.0, 1.0)
|
||||
var t4: Double by parameters
|
||||
|
||||
init {
|
||||
t1 = 1.0
|
||||
t2 = 0.75
|
||||
t3 = 0.5
|
||||
t4 = 0.3
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user