44 lines
1.3 KiB
Kotlin
44 lines
1.3 KiB
Kotlin
@file:Suppress("RUNTIME_ANNOTATION_NOT_SUPPORTED")
|
|
|
|
package org.openrndr.extra.fx.edges
|
|
|
|
import org.openrndr.color.ColorRGBa
|
|
import org.openrndr.draw.Filter
|
|
import org.openrndr.draw.Filter1to1
|
|
import org.openrndr.extra.fx.fx_contour
|
|
import org.openrndr.extra.fx.mppFilterShader
|
|
import org.openrndr.extra.parameters.ColorParameter
|
|
import org.openrndr.extra.parameters.Description
|
|
import org.openrndr.extra.parameters.DoubleParameter
|
|
import org.openrndr.extra.parameters.IntParameter
|
|
|
|
@Description("Contour")
|
|
class Contour : Filter1to1(mppFilterShader(fx_contour, "contour")) {
|
|
@DoubleParameter("levels", 1.0, 16.0)
|
|
var levels: Double by parameters
|
|
|
|
@DoubleParameter("contour width", 0.0, 4.0)
|
|
var contourWidth: Double by parameters
|
|
|
|
@DoubleParameter("contour opacity", 0.0, 1.0)
|
|
var contourOpacity: Double by parameters
|
|
|
|
@DoubleParameter("background opacity", 0.0, 1.0)
|
|
var backgroundOpacity: Double by parameters
|
|
|
|
@ColorParameter("contour color")
|
|
var contourColor: ColorRGBa by parameters
|
|
|
|
@IntParameter("window", 0, 10)
|
|
var window: Int by parameters
|
|
|
|
init {
|
|
levels = 6.0
|
|
contourWidth = 0.4
|
|
contourColor = ColorRGBa.BLACK
|
|
backgroundOpacity = 1.0
|
|
contourOpacity = 1.0
|
|
window = 1
|
|
}
|
|
}
|