[orx-fx] Use the appropriate FilterNto1 interfaces

* Fix webgl 2 compatibility
 * Add LumaLaplacian, ACESTonemap, ReinhardTonemap, DirectionalHashBlur
This commit is contained in:
Edwin Jakobs
2022-12-28 13:57:27 +01:00
parent beb53bbde7
commit 750b5ef67e
87 changed files with 578 additions and 175 deletions

View File

@@ -36,7 +36,7 @@ class Post : Extension {
inner class IntermediateBuffers {
internal val buffers = mutableMapOf<Int, ColorBuffer>()
operator fun get(index: Int) : ColorBuffer {
operator fun get(index: Int): ColorBuffer {
return buffers.getOrPut(index) {
colorBuffer(output!!.width, output!!.height, output!!.contentScale, type = intermediateType)
}
@@ -63,6 +63,8 @@ class Post : Extension {
// in case the attributes of the existing buffers no longer match those of the active render target
if (lit.width != art.width || lit.height != art.height || lit.contentScale != art.contentScale || lit.multisample != art.multisample) {
lit.colorBuffer(0).destroy()
lit.depthBuffer?.destroy()
lit.detachDepthBuffer()
lit.detachColorAttachments()
lit.destroy()
inputTarget = null

View File

@@ -1,6 +1,7 @@
package org.openrndr.extra.fx.antialias
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_fxaa
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
@@ -10,7 +11,7 @@ import org.openrndr.extra.parameters.DoubleParameter
* FXAA approximate antialiasing filter. Only works on LDR inputs
*/
@Description("FXAA")
class FXAA : Filter( mppFilterShader(fx_fxaa, "fxaa")) {
class FXAA : Filter1to1( mppFilterShader(fx_fxaa, "fxaa")) {
/**
* luma threshold, default value is 0.5
*/

View File

@@ -1,10 +1,12 @@
package org.openrndr.extra.fx.blend
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.Filter2to1
import org.openrndr.extra.fx.*
import org.openrndr.extra.parameters.BooleanParameter
class ColorBurn : Filter(mppFilterShader(fx_color_burn, "color-burn")) {
class ColorBurn : Filter2to1(mppFilterShader(fx_color_burn, "color-burn")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -13,7 +15,7 @@ class ColorBurn : Filter(mppFilterShader(fx_color_burn, "color-burn")) {
}
}
class ColorDodge : Filter(mppFilterShader(fx_color_dodge, "color-dodge")) {
class ColorDodge : Filter2to1(mppFilterShader(fx_color_dodge, "color-dodge")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -22,7 +24,7 @@ class ColorDodge : Filter(mppFilterShader(fx_color_dodge, "color-dodge")) {
}
}
class Darken : Filter(mppFilterShader(fx_darken, "darken")) {
class Darken : Filter2to1(mppFilterShader(fx_darken, "darken")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -31,7 +33,7 @@ class Darken : Filter(mppFilterShader(fx_darken, "darken")) {
}
}
class HardLight : Filter(mppFilterShader(fx_hard_light, "hard-light")) {
class HardLight : Filter2to1(mppFilterShader(fx_hard_light, "hard-light")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -40,7 +42,7 @@ class HardLight : Filter(mppFilterShader(fx_hard_light, "hard-light")) {
}
}
class Lighten : Filter(mppFilterShader(fx_lighten, "lighten")) {
class Lighten : Filter2to1(mppFilterShader(fx_lighten, "lighten")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -49,7 +51,7 @@ class Lighten : Filter(mppFilterShader(fx_lighten, "lighten")) {
}
}
class Multiply : Filter(mppFilterShader(fx_multiply,"multiply")) {
class Multiply : Filter2to1(mppFilterShader(fx_multiply,"multiply")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -58,7 +60,7 @@ class Multiply : Filter(mppFilterShader(fx_multiply,"multiply")) {
}
}
class Normal : Filter(mppFilterShader(fx_normal, "normal")) {
class Normal : Filter2to1(mppFilterShader(fx_normal, "normal")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -67,7 +69,7 @@ class Normal : Filter(mppFilterShader(fx_normal, "normal")) {
}
}
class Overlay : Filter(mppFilterShader(fx_overlay, "overlay")) {
class Overlay : Filter2to1(mppFilterShader(fx_overlay, "overlay")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -76,7 +78,7 @@ class Overlay : Filter(mppFilterShader(fx_overlay, "overlay")) {
}
}
class Screen : Filter(mppFilterShader(fx_screen, "screen")) {
class Screen : Filter2to1(mppFilterShader(fx_screen, "screen")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -86,18 +88,18 @@ class Screen : Filter(mppFilterShader(fx_screen, "screen")) {
}
class SourceIn : Filter(mppFilterShader(fx_source_in, "source-in"))
class SourceOut : Filter(mppFilterShader(fx_source_out,"source-out"))
class SourceAtop : Filter(mppFilterShader(fx_source_atop, "source-atop"))
class DestinationIn : Filter(mppFilterShader(fx_destination_in, "destination-in"))
class DestinationOut : Filter(mppFilterShader(fx_destination_out, "destination-out"))
class DestinationAtop : Filter(mppFilterShader(fx_destination_atop, "destination-atop"))
class Xor : Filter(mppFilterShader(fx_xor, "xor"))
class SourceIn : Filter2to1(mppFilterShader(fx_source_in, "source-in"))
class SourceOut : Filter2to1(mppFilterShader(fx_source_out,"source-out"))
class SourceAtop : Filter2to1(mppFilterShader(fx_source_atop, "source-atop"))
class DestinationIn : Filter2to1(mppFilterShader(fx_destination_in, "destination-in"))
class DestinationOut : Filter2to1(mppFilterShader(fx_destination_out, "destination-out"))
class DestinationAtop : Filter2to1(mppFilterShader(fx_destination_atop, "destination-atop"))
class Xor : Filter2to1(mppFilterShader(fx_xor, "xor"))
class MultiplyContrast : Filter(mppFilterShader(fx_multiply_contrast, "multiply-contrast"))
class MultiplyContrast : Filter2to1(mppFilterShader(fx_multiply_contrast, "multiply-contrast"))
class Passthrough : Filter(mppFilterShader(fx_passthrough, "passthrough"))
class Add : Filter(mppFilterShader(fx_add, "add")) {
class Passthrough : Filter1to1(mppFilterShader(fx_passthrough, "passthrough"))
class Add : Filter2to1(mppFilterShader(fx_add, "add")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters
@@ -105,7 +107,7 @@ class Add : Filter(mppFilterShader(fx_add, "add")) {
clip = false
}
}
class Subtract : Filter(mppFilterShader(fx_subtract,"subtract")) {
class Subtract : Filter2to1(mppFilterShader(fx_subtract,"subtract")) {
@BooleanParameter("source clip")
var clip: Boolean by parameters

View File

@@ -14,7 +14,7 @@ import org.openrndr.math.Vector2
* Approximate separated Gaussian blur
*/
@Description("Approximate Gaussian blur")
class ApproximateGaussianBlur : Filter(mppFilterShader(fx_approximate_gaussian_blur, "approximate gaussian blur")) {
class ApproximateGaussianBlur : Filter1to1(mppFilterShader(fx_approximate_gaussian_blur, "approximate gaussian blur")) {
/**
* blur sample window, default value is 5
*/

View File

@@ -9,7 +9,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.extra.parameters.IntParameter
@Description("Bloom")
class Bloom(blur: Filter = ApproximateGaussianBlur()) : Filter(mppFilterShader(fx_bloom, "bloom")) {
class Bloom(blur: Filter = ApproximateGaussianBlur()) : Filter1to1(mppFilterShader(fx_bloom, "bloom")) {
/**
* the blur filter to use for the bloom, default is Approximate Gaussian Blur
*/

View File

@@ -13,7 +13,7 @@ import org.openrndr.math.Vector2
* BoxBlur implemented as a separable filter
*/
@Description("Box-blur")
class BoxBlur : Filter(mppFilterShader(fx_box_blur,"box-blur")) {
class BoxBlur : Filter1to1(mppFilterShader(fx_box_blur,"box-blur")) {
data class ColorBufferDescription(val width: Int, val height: Int, val contentScale: Double, val format: ColorFormat, val type: ColorType)

View File

@@ -12,7 +12,13 @@ import org.openrndr.extra.parameters.IntParameter
* Directional blur filter. Takes source image and direction buffer inputs
*/
@Description("Directional blur")
class DirectionalBlur : Filter(mppFilterShader(fx_directional_blur, "directional-blur")) {
class DirectionalBlur : Filter2to1(mppFilterShader(fx_directional_blur, "directional-blur")) {
/**
* Should the blur window be centered, default is false
*/
@BooleanParameter("center window")
var centerWindow: Boolean by parameters
/**
* The sample window, default is 5
@@ -38,11 +44,14 @@ class DirectionalBlur : Filter(mppFilterShader(fx_directional_blur, "directional
@BooleanParameter("perpendicular")
var perpendicular: Boolean by parameters
init {
window = 5
spread = 1.0
gain = 1.0
perpendicular = false
centerWindow = false
}
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>) {

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Frame blur")
class FrameBlur : Filter(mppFilterShader(fx_frame_blur, "frame-blur")) {
class FrameBlur : Filter1to1(mppFilterShader(fx_frame_blur, "frame-blur")) {
@DoubleParameter("blend", 0.0, 1.0)
var blend: Double by parameters

View File

@@ -1,6 +1,6 @@
package org.openrndr.extra.fx.blur
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_gaussian_blur
import org.openrndr.extra.fx.mppFilterShader
@@ -12,7 +12,7 @@ import org.openrndr.extra.parameters.IntParameter
* Exact Gaussian blur, implemented as a single pass filter
*/
@Description("Gaussian blur")
class GaussianBlur : Filter(mppFilterShader(fx_gaussian_blur,"gaussian-blur")) {
class GaussianBlur : Filter1to1(mppFilterShader(fx_gaussian_blur,"gaussian-blur")) {
/**
* The sample window, default value is 5

View File

@@ -1,6 +1,10 @@
package org.openrndr.extra.fx.blur
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.Filter2to1
import org.openrndr.draw.Filter3to1
import org.openrndr.extra.fx.fx_directional_hash_blur
import org.openrndr.extra.fx.fx_hash_blur
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
@@ -8,7 +12,10 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.extra.parameters.IntParameter
@Description("Hash blur")
class HashBlur : Filter(mppFilterShader(fx_hash_blur, "hash-blur")) {
class HashBlur : Filter1to1(mppFilterShader(fx_hash_blur, "hash-blur")) {
private var dynamic: Boolean by parameters
/**
* Blur radius in pixels, default is 5.0
*/
@@ -33,9 +40,125 @@ class HashBlur : Filter(mppFilterShader(fx_hash_blur, "hash-blur")) {
var gain: Double by parameters
init {
dynamic = false
radius = 5.0
time = 0.0
samples = 30
gain = 1.0
}
}
}
@Description("Hash blur")
class HashBlurDynamic: Filter2to1(mppFilterShader(fx_hash_blur, "hash-blur")) {
private var dynamic: Boolean by parameters
/**
* Blur radius in pixels, default is 5.0
*/
@DoubleParameter("blur radius", 1.0, 25.0)
var radius: Double by parameters
/**
* Time/seed, this should be fed with seconds, default is 0.0
*/
var time: Double by parameters
/**
* Number of samples, default is 30
*/
@IntParameter("number of samples", 1, 100)
var samples: Int by parameters
/**
* Post-blur gain, default is 1.0
*/
@DoubleParameter("image gain", 0.0, 2.0)
var gain: Double by parameters
init {
dynamic = true
radius = 5.0
time = 0.0
samples = 30
gain = 1.0
}
}
@Description("Directional hash blur")
class DirectionalHashBlur : Filter2to1(mppFilterShader(fx_directional_hash_blur, "directional-hash-blur")) {
/**
* Blur radius in pixels, default is 5.0
*/
@DoubleParameter("blur radius", 0.0, 25.0)
var radius: Double by parameters
@DoubleParameter("blur spread", 0.0, 25.0)
var spread: Double by parameters
/**
* Time/seed, this should be fed with seconds, default is 0.0
*/
var time: Double by parameters
/**
* Number of samples, default is 30
*/
@IntParameter("number of samples", 1, 100)
var samples: Int by parameters
/**
* Post-blur gain, default is 1.0
*/
@DoubleParameter("image gain", 0.0, 2.0)
var gain: Double by parameters
init {
radius = 5.0
spread = 25.0
time = 0.0
samples = 30
gain = 1.0
}
}
@Description("Directional hash blur")
class DirectionalHashBlurDynamic : Filter3to1(mppFilterShader("#define RADIUS_FROM_TEXTURE\n${fx_directional_hash_blur}", "directional-hash-blur")) {
/**
* Blur radius in pixels, default is 5.0
*/
@DoubleParameter("blur radius", 0.0, 25.0)
var radius: Double by parameters
@DoubleParameter("blur spread", 0.0, 25.0)
var spread: Double by parameters
/**
* Time/seed, this should be fed with seconds, default is 0.0
*/
var time: Double by parameters
/**
* Number of samples, default is 30
*/
@IntParameter("number of samples", 1, 100)
var samples: Int by parameters
/**
* Post-blur gain, default is 1.0
*/
@DoubleParameter("image gain", 0.0, 2.0)
var gain: Double by parameters
init {
radius = 5.0
spread = 25.0
time = 0.0
samples = 30
gain = 1.0
}
}

View File

@@ -32,7 +32,7 @@ private class LaserBlurPass : Filter(mppFilterShader(fx_laser_blur, "laser-blur"
}
@Description("Laser blur")
class LaserBlur : Filter() {
class LaserBlur : Filter1to1() {
@Vector2Parameter("center", order = 0)
var center = Vector2.ZERO

View File

@@ -17,7 +17,7 @@ import kotlin.math.sin
* BoxBlur implemented as a separable filter
*/
@Description("Line blur")
class LineBlur : Filter(mppFilterShader(fx_box_blur, "line-blur")) {
class LineBlur : Filter1to1(mppFilterShader(fx_box_blur, "line-blur")) {
/**
* The sample window, default is 5

View File

@@ -42,7 +42,7 @@ class BloomCombine : Filter(mppFilterShader(fx_bloom_combine, "bloom-combine"))
}
@Description("MipBloom")
open class MipBloom<T : Filter>(val blur: T) : Filter(mppFilterShader(fx_bloom_combine, "bloom-combine")) {
open class MipBloom<T : Filter>(val blur: T) : Filter1to1(mppFilterShader(fx_bloom_combine, "bloom-combine")) {
var passes = 6
@DoubleParameter("shape", 0.0, 4.0)

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.math.Vector2
@Description("Zoom Blur")
class ZoomBlur : Filter(mppFilterShader(fx_zoom_blur, "zoom-blur")) {
class ZoomBlur : Filter1to1(mppFilterShader(fx_zoom_blur, "zoom-blur")) {
var center: Vector2 by parameters
@DoubleParameter("strength", 0.0, 1.0)

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.math.Vector2
@Description("Chromatic Aberration")
class ChromaticAberration : Filter(mppFilterShader(fx_chromatic_aberration, "chromatic-aberration")) {
class ChromaticAberration : Filter1to1(mppFilterShader(fx_chromatic_aberration, "chromatic-aberration")) {
/**
* aberration factor, default value is 8.0
*/

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Color correction")
class ColorCorrection : Filter(mppFilterShader(fx_color_correction, "color-correction")) {
class ColorCorrection : Filter1to1(mppFilterShader(fx_color_correction, "color-correction")) {
@DoubleParameter("brightness", -1.0, 1.0, order = 0)
var brightness: Double by parameters

View File

@@ -4,7 +4,7 @@ import org.openrndr.draw.*
import org.openrndr.extra.fx.fx_color_lookup
import org.openrndr.extra.fx.mppFilterShader
class ColorLookup(lookup: ColorBuffer) : Filter(mppFilterShader(fx_color_lookup, "color-lookup")) {
class ColorLookup(lookup: ColorBuffer) : Filter1to1(mppFilterShader(fx_color_lookup, "color-lookup")) {
/** a color look-up texture */
var lookup: ColorBuffer by parameters

View File

@@ -2,16 +2,17 @@ package org.openrndr.extra.fx.color
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_color_mix
import org.openrndr.extra.fx.fx_color_tint
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
import org.openrndr.extra.parameters.Description
class ColorMix : Filter(mppFilterShader(fx_color_mix, "color-mix"))
class ColorMix : Filter1to1(mppFilterShader(fx_color_mix, "color-mix"))
@Description("Tint")
class ColorTint : Filter(mppFilterShader(fx_color_tint, "color-tint")) {
class ColorTint : Filter1to1(mppFilterShader(fx_color_tint, "color-tint")) {
@ColorParameter("tint")
var tint: ColorRGBa by parameters

View File

@@ -1,6 +1,7 @@
package org.openrndr.extra.fx.color
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.*
import org.openrndr.extra.fx.fx_rgb_to_oklab
import org.openrndr.extra.fx.fx_rgb_to_ycbcr
@@ -8,15 +9,15 @@ import org.openrndr.extra.fx.fx_ycbcr_to_rgb
import org.openrndr.extra.shaderphrases.preprocess
import org.openrndr.extra.color.phrases.ColorPhraseBook
class RgbToYCbcr : Filter(mppFilterShader(fx_rgb_to_ycbcr, "rgb-to-ycbcr"))
class YcbcrToRgb : Filter(mppFilterShader(fx_ycbcr_to_rgb, "ycbcr_to_rgb"))
class RgbToYCbcr : Filter1to1(mppFilterShader(fx_rgb_to_ycbcr, "rgb-to-ycbcr"))
class YcbcrToRgb : Filter1to1(mppFilterShader(fx_ycbcr_to_rgb, "ycbcr_to_rgb"))
class RgbToOkLab : Filter(mppFilterShader(run {
class RgbToOkLab : Filter1to1(mppFilterShader(run {
ColorPhraseBook.register()
fx_rgb_to_oklab.preprocess()
}, "rgb-to-oklab"))
class OkLabToRgb : Filter(mppFilterShader(run {
class OkLabToRgb : Filter1to1(mppFilterShader(run {
ColorPhraseBook.register()
fx_oklab_to_rgb.preprocess()
}, "oklab-to-rgb"))

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.color
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_duotone
import org.openrndr.extra.parameters.BooleanParameter
@@ -15,7 +16,7 @@ import org.openrndr.extra.color.presets.DARK_GRAY
import org.openrndr.extra.color.presets.NAVY
@Description("Duotone")
class Duotone : Filter(filterShaderFromCode(run {
class Duotone : Filter1to1(filterShaderFromCode(run {
ColorPhraseBook.register()
fx_duotone.preprocess()
}, "duotone")) {

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.color
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_duotone_gradient
import org.openrndr.extra.parameters.BooleanParameter
@@ -15,7 +16,7 @@ import org.openrndr.extra.color.presets.CORAL
import org.openrndr.extra.color.presets.NAVY
@Description("Duotone Gradient")
class DuotoneGradient : Filter(filterShaderFromCode(run {
class DuotoneGradient : Filter1to1(filterShaderFromCode(run {
ColorPhraseBook.register()
fx_duotone_gradient.preprocess()
}, "duotone-gradient")) {

View File

@@ -1,6 +1,7 @@
package org.openrndr.extra.fx.color
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_invert
import org.openrndr.extra.fx.fx_sepia
import org.openrndr.extra.fx.mppFilterShader
@@ -8,7 +9,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Invert")
class Invert : Filter(mppFilterShader(fx_invert, "invert")) {
class Invert : Filter1to1(mppFilterShader(fx_invert, "invert")) {
@DoubleParameter("amount", 0.0, 1.0)
var amount: Double by parameters

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.color
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_luma_map
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
@@ -9,7 +10,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Luma map ")
class LumaMap : Filter(mppFilterShader(fx_luma_map, "luma-map")) {
class LumaMap : Filter1to1(mppFilterShader(fx_luma_map, "luma-map")) {
@ColorParameter("foreground color")
var foreground: ColorRGBa by parameters

View File

@@ -1,13 +1,14 @@
package org.openrndr.extra.fx.color
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_luma_opacity
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Luma map ")
class LumaOpacity : Filter(mppFilterShader(fx_luma_opacity, "luma-opacity")) {
class LumaOpacity : Filter1to1(mppFilterShader(fx_luma_opacity, "luma-opacity")) {
@DoubleParameter("foreground luma",0.0, 1.0)
var foregroundLuma: Double by parameters

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.color
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_luma_threshold
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
@@ -9,7 +10,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Luma threshold ")
class LumaThreshold : Filter(mppFilterShader(fx_luma_threshold, "luma-threshold")) {
class LumaThreshold : Filter1to1(mppFilterShader(fx_luma_threshold, "luma-threshold")) {
@DoubleParameter("threshold value", 0.0, 1.0)
var threshold: Double by parameters

View File

@@ -1,13 +1,14 @@
package org.openrndr.extra.fx.color
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_pal
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Pal TV Effect")
class Pal : Filter(mppFilterShader(fx_pal,"pal")) {
class Pal : Filter1to1(mppFilterShader(fx_pal,"pal")) {
@DoubleParameter("amount", 0.0, 1.0)
var amount: Double by parameters
@DoubleParameter("pixelation", 0.0, 1.0)

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.color
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_duotone
import org.openrndr.extra.fx.fx_posterize
@@ -17,7 +18,7 @@ import org.openrndr.extra.color.presets.DARK_GRAY
import org.openrndr.extra.color.presets.NAVY
@Description("Posterize")
class Posterize : Filter(filterShaderFromCode(fx_posterize, "posterize")) {
class Posterize : Filter1to1(filterShaderFromCode(fx_posterize, "posterize")) {
@IntParameter("levels", 2, 32, order = 0)
var levels: Int by parameters

View File

@@ -1,13 +1,14 @@
package org.openrndr.extra.fx.color
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_sepia
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Sepia")
class Sepia : Filter(mppFilterShader(fx_sepia, "sepia")) {
class Sepia : Filter1to1(mppFilterShader(fx_sepia, "sepia")) {
@DoubleParameter("amount", 0.0, 1.0)
var amount: Double by parameters

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.color
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_set_background
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
@@ -9,7 +10,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Set background")
class SetBackground : Filter(mppFilterShader(fx_set_background, "set-background")) {
class SetBackground : Filter1to1(mppFilterShader(fx_set_background, "set-background")) {
@ColorParameter("background color")
var background: ColorRGBa by parameters

View File

@@ -2,10 +2,11 @@ package org.openrndr.extra.fx.color
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_subtract_constant
import org.openrndr.extra.fx.mppFilterShader
class SubtractConstant : Filter(mppFilterShader(fx_subtract_constant, "subtract-constant")) {
class SubtractConstant : Filter1to1(mppFilterShader(fx_subtract_constant, "subtract-constant")) {
var constant: ColorRGBa by parameters
init {

View File

@@ -1,10 +1,11 @@
package org.openrndr.extra.fx.colormap
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.DoubleParameter
abstract class ColormapFilter(code: String, name: String) : Filter(mppFilterShader(code, name)) {
abstract class ColormapFilter(code: String, name: String) : Filter1to1(mppFilterShader(code, name)) {
@DoubleParameter(label = "min value", low = 0.0, high = 1.0, order = 0)
var minValue: Double by parameters

View File

@@ -1,9 +1,6 @@
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.draw.*
import org.openrndr.extra.fx.fx_block_repeat
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.BooleanParameter
@@ -11,7 +8,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Block repeat")
class BlockRepeat : Filter(mppFilterShader(fx_block_repeat, "block-repeat")) {
class BlockRepeat : Filter1to1(mppFilterShader(fx_block_repeat, "block-repeat")) {
@DoubleParameter("block width", 0.0, 1.0, order = 0)
var blockWidth: Double by parameters

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.math.Vector3
@Description("Displace blend")
class DisplaceBlend : Filter(mppFilterShader(fx_displace_blend, "displace-blend")) {
class DisplaceBlend : Filter2to1(mppFilterShader(fx_displace_blend, "displace-blend")) {
var seed: Vector3 by parameters
@DoubleParameter("offset", -1.0, 1.0)

View File

@@ -7,7 +7,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Fisheye")
class Fisheye : Filter(mppFilterShader(fx_fisheye, "fisheye")) {
class Fisheye : Filter1to1(mppFilterShader(fx_fisheye, "fisheye")) {
@DoubleParameter("strength", -1.0, 1.0, order = 0)
var strength: Double by parameters

View File

@@ -1,9 +1,6 @@
package org.openrndr.extra.fx.distort
import org.openrndr.draw.ColorBuffer
import org.openrndr.draw.Filter
import org.openrndr.draw.createEquivalent
import org.openrndr.draw.isEquivalentTo
import org.openrndr.draw.*
import org.openrndr.extra.fx.fx_fluid_distort
import org.openrndr.extra.fx.fx_uvmap
import org.openrndr.extra.fx.mppFilterShader
@@ -20,7 +17,7 @@ private class FluidDistortFilter : Filter(mppFilterShader(fx_fluid_distort, "flu
}
}
class FluidDistort : Filter() {
class FluidDistort : Filter1to1() {
var blend: Double = 1.0
var outputUV = false

View File

@@ -1,9 +1,6 @@
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.draw.*
import org.openrndr.extra.fx.fx_lenses
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.BooleanParameter
@@ -12,7 +9,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.extra.parameters.IntParameter
@Description("Lenses")
class Lenses : Filter(mppFilterShader(fx_lenses, "block-repeat")) {
class Lenses : Filter1to1(mppFilterShader(fx_lenses, "block-repeat")) {
@IntParameter("rows", 1, 64, order = 0)
var rows: Int by parameters

View File

@@ -10,7 +10,7 @@ import org.openrndr.math.Vector3
import org.openrndr.math.transforms.transform
@Description("Perspective plane")
class PerspectivePlane : Filter(mppFilterShader(fx_perspective_plane, "perspective-plane")) {
class PerspectivePlane : Filter1to1(mppFilterShader(fx_perspective_plane, "perspective-plane")) {
// @DoubleParameter("camera x", -1.0, 1.0, order = 0)
var cameraX: Double = 0.0
// @DoubleParameter("camera y", -1.0, 1.0, order = 1)

View File

@@ -8,7 +8,7 @@ import org.openrndr.math.Vector2
import org.openrndr.math.Vector3
@Description("Perturb")
class Perturb : Filter(mppFilterShader(fx_perturb, "perturb")) {
class Perturb : Filter1to1(mppFilterShader(fx_perturb, "perturb")) {
var seed: Vector3 by parameters
/**
* base noise scale, default is Vector3(1.0, 1.0, 1.0)

View File

@@ -1,9 +1,6 @@
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.draw.*
import org.openrndr.extra.fx.fx_polar_to_rectangular
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.BooleanParameter
@@ -12,7 +9,7 @@ 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")) {
class PolarToRectangular : Filter1to1(mppFilterShader(fx_polar_to_rectangular, "polar-to-rectangular")) {
@BooleanParameter("log polar")
var logPolar:Boolean by parameters

View File

@@ -1,9 +1,6 @@
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.draw.*
import org.openrndr.extra.fx.fx_rectangular_to_polar
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.BooleanParameter
@@ -13,7 +10,7 @@ import org.openrndr.math.Vector2
import kotlin.math.log
@Description("Rectangular to polar")
class RectangularToPolar : Filter(mppFilterShader(fx_rectangular_to_polar, "rectangular-to-polar")) {
class RectangularToPolar : Filter1to1(mppFilterShader(fx_rectangular_to_polar, "rectangular-to-polar")) {
@BooleanParameter("log polar")
var logPolar:Boolean by parameters

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.extra.parameters.IntParameter
@Description("Stack repeat")
class StackRepeat : Filter(mppFilterShader(fx_stack_repeat, "stack-repeat")) {
class StackRepeat : Filter1to1(mppFilterShader(fx_stack_repeat, "stack-repeat")) {
@DoubleParameter("zoom", -1.0, 1.0, order = 0)
var zoom: Double by parameters

View File

@@ -7,7 +7,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Stretch waves")
class StretchWaves : Filter(mppFilterShader(fx_stretch_waves, "stretch-waves")) {
class StretchWaves : Filter1to1(mppFilterShader(fx_stretch_waves, "stretch-waves")) {
@DoubleParameter("distortion", -0.0,1.0, 1)
var distortion: Double by parameters

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.distort
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_tape_noise
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.BooleanParameter
@@ -10,7 +11,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Tape noise")
class TapeNoise : Filter(mppFilterShader(fx_tape_noise, "tape-noise")) {
class TapeNoise : Filter1to1(mppFilterShader(fx_tape_noise, "tape-noise")) {
var time: Double by parameters
@DoubleParameter("gain", 0.0, 1.0)

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.extra.parameters.IntParameter
@Description("Tiles")
class Tiles : Filter(mppFilterShader(fx_tiles, "tiles")) {
class Tiles : Filter1to1(mppFilterShader(fx_tiles, "tiles")) {
@DoubleParameter("rotation", -180.0, 180.0, order = 2)
var rotation: Double by parameters

View File

@@ -1,6 +1,7 @@
package org.openrndr.extra.fx.distort
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_video_glitch
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.BooleanParameter
@@ -8,7 +9,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Video glitch")
class VideoGlitch : Filter(mppFilterShader(fx_video_glitch, "video-glitch")) {
class VideoGlitch : Filter1to1(mppFilterShader(fx_video_glitch, "video-glitch")) {
var time: Double by parameters
@DoubleParameter("amplitude", 0.0, 10.0)

View File

@@ -9,7 +9,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.extra.parameters.IntParameter
@Description("Horizontal wave")
class HorizontalWave : Filter(mppFilterShader(fx_horizontal_wave, "horizontal-wave")) {
class HorizontalWave : Filter1to1(mppFilterShader(fx_horizontal_wave, "horizontal-wave")) {
@DoubleParameter("frequency", 0.0, 64.0, order = 1)
var frequency: Double by parameters

View File

@@ -1,13 +1,14 @@
package org.openrndr.extra.fx.dither
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
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")) {
class ADither: Filter1to1(mppFilterShader(fx_a_dither, "a-dither")) {
@IntParameter("pattern index", 0, 3)
var pattern: Int by parameters

View File

@@ -1,13 +1,14 @@
package org.openrndr.extra.fx.dither
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
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")) {
class CMYKHalftone: Filter1to1(mppFilterShader(fx_cmyk_halftone, "cmyk-halftone")) {
@DoubleParameter("scale", 1.0, 30.0, precision = 4)
var scale: Double by parameters

View File

@@ -1,13 +1,14 @@
package org.openrndr.extra.fx.dither
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
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")) {
class Crosshatch : Filter1to1(mppFilterShader(fx_crosshatch, "crosshatch")) {
@DoubleParameter("threshold 1", 0.0, 1.0)
var t1: Double by parameters

View File

@@ -1,6 +1,7 @@
package org.openrndr.extra.fx.dither
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_luma_halftone
import org.openrndr.extra.parameters.BooleanParameter
@@ -9,7 +10,7 @@ import org.openrndr.extra.parameters.DoubleParameter
@Description("Luma Halftone")
class LumaHalftone: Filter(filterShaderFromCode(fx_luma_halftone, "luma-halftone")) {
class LumaHalftone: Filter1to1(filterShaderFromCode(fx_luma_halftone, "luma-halftone")) {
@DoubleParameter("scale", 1.0, 30.0, precision = 4)
var scale: Double by parameters

View File

@@ -2,6 +2,7 @@ package org.openrndr.extra.fx.edges
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_canny_edge_detector
import org.openrndr.extra.parameters.ColorParameter
@@ -9,7 +10,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Canny Edge Detector")
class CannyEdgeDetector : Filter(
class CannyEdgeDetector : Filter1to1(
filterShaderFromCode(fx_canny_edge_detector, "canny-edge-detector")
) {

View File

@@ -2,6 +2,7 @@ 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
@@ -10,7 +11,7 @@ import org.openrndr.extra.parameters.DoubleParameter
import org.openrndr.extra.parameters.IntParameter
@Description("Contour")
class Contour : Filter(mppFilterShader(fx_contour, "contour")) {
class Contour : Filter1to1(mppFilterShader(fx_contour, "contour")) {
@DoubleParameter("levels", 1.0, 16.0)
var levels: Double by parameters

View File

@@ -18,7 +18,7 @@ internal class EdgesWork1 : Filter(mppFilterShader(fx_edges_work_1, "edges-work-
}
@Description("Edges Work")
open class EdgesWork : Filter(mppFilterShader(fx_edges_work_2, "edges-work-2")) {
open class EdgesWork : Filter1to1(mppFilterShader(fx_edges_work_2, "edges-work-2")) {
/**
* radius, default value is 1.0
*/

View File

@@ -0,0 +1,31 @@
package org.openrndr.extra.fx.edges
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_luma_laplacian
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Luma Sobel")
class LumaLaplacian : Filter1to1(mppFilterShader(fx_luma_laplacian, "luma-laplacian")) {
@ColorParameter("background color")
var backgroundColor: ColorRGBa by parameters
@ColorParameter("edge color")
var edgeColor: ColorRGBa by parameters
@DoubleParameter("background opacity", 0.0, 1.0)
var backgroundOpacity: Double by parameters
@DoubleParameter("edge opacity", 0.0, 1.0)
var edgeOpacity: Double by parameters
init {
backgroundColor = ColorRGBa.BLACK
edgeColor = ColorRGBa.WHITE
edgeOpacity = 1.0
backgroundOpacity = 1.0
}
}

View File

@@ -2,6 +2,7 @@ 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_luma_sobel
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.ColorParameter
@@ -9,7 +10,7 @@ import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Luma Sobel")
class LumaSobel : Filter(mppFilterShader(fx_luma_sobel, "luma-sobel")) {
class LumaSobel : Filter1to1(mppFilterShader(fx_luma_sobel, "luma-sobel")) {
@ColorParameter("background color")
var backgroundColor: ColorRGBa by parameters

View File

@@ -1,6 +1,7 @@
package org.openrndr.extra.fx.grain
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_film_grain
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.BooleanParameter
@@ -10,7 +11,7 @@ import org.openrndr.extra.parameters.DoubleParameter
* Film grain filter
*/
@Description("film grain")
class FilmGrain : Filter(mppFilterShader(fx_film_grain, "film-grain")) {
class FilmGrain : Filter1to1(mppFilterShader(fx_film_grain, "film-grain")) {
@BooleanParameter("use color")
var useColor: Boolean by parameters

View File

@@ -1,4 +1,5 @@
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_film_grain
import org.openrndr.extra.fx.fx_multiply_u
@@ -10,7 +11,7 @@ import org.openrndr.extra.parameters.DoubleParameter
* Multiply by u coordinate
*/
@Description("multiply u")
class MultiplyU : Filter(filterShaderFromCode(fx_multiply_u, "multiply-u")) {
class MultiplyU : Filter1to1(filterShaderFromCode(fx_multiply_u, "multiply-u")) {
@DoubleParameter("multiplication bias", 0.0, 2.0)
var bias: Double by parameters
init {

View File

@@ -1,4 +1,5 @@
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_multiply_v
import org.openrndr.extra.parameters.BooleanParameter
@@ -8,7 +9,7 @@ import org.openrndr.extra.parameters.DoubleParameter
* Multiply by v coordinate
*/
@Description("multiply v")
class MultiplyV : Filter(filterShaderFromCode(fx_multiply_v, "multiply-v")) {
class MultiplyV : Filter1to1(filterShaderFromCode(fx_multiply_v, "multiply-v")) {
@DoubleParameter("multiplication bias", 0.0, 2.0)
var bias: Double by parameters

View File

@@ -1,4 +1,5 @@
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.draw.filterShaderFromCode
import org.openrndr.extra.fx.fx_square
import org.openrndr.extra.parameters.Description
@@ -6,5 +7,5 @@ import org.openrndr.extra.parameters.Description
* Square input texture values
*/
@Description("square")
class Square : Filter(filterShaderFromCode(fx_square, "square")) {
class Square : Filter1to1(filterShaderFromCode(fx_square, "square")) {
}

View File

@@ -2,13 +2,14 @@ package org.openrndr.extra.fx.patterns
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_checkers
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("Checkers pattern")
class Checkers : Filter(mppFilterShader(fx_checkers, "checkers")) {
class Checkers : Filter1to1(mppFilterShader(fx_checkers, "checkers")) {
var background: ColorRGBa by parameters
var foreground: ColorRGBa by parameters

View File

@@ -16,7 +16,7 @@ private class Blend : Filter(mppFilterShader(fx_dropshadow_blend, "dropshadow-bl
}
@Description("Drop shadow")
class DropShadow : Filter(mppFilterShader(fx_dropshadow_blur, "dropshadow-blur")) {
class DropShadow : Filter1to1(mppFilterShader(fx_dropshadow_blur, "dropshadow-blur")) {
@IntParameter("blur window", 1, 25)
var window: Int by parameters
var spread: Double by parameters

View File

@@ -0,0 +1,16 @@
package org.openrndr.extra.fx.tonemap
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_aces_tonemap
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("ACES tonemap")
class ACESTonemap : Filter1to1(mppFilterShader(fx_aces_tonemap, "aces-tonemap")) {
@DoubleParameter("exposure bias", 0.0, 128.0)
var exposureBias:Double by parameters
init {
exposureBias = 1.0
}
}

View File

@@ -0,0 +1,20 @@
package org.openrndr.extra.fx.tonemap
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_reinhard_tonemap
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
import org.openrndr.extra.parameters.DoubleParameter
@Description("ACES tonemap")
class ReinhardTonemap : Filter1to1(mppFilterShader(fx_reinhard_tonemap, "reinhard-tonemap")) {
@DoubleParameter("exposure bias", 0.0, 128.0)
var exposureBias:Double by parameters
@DoubleParameter("maximum luminance", 0.0, 128.0)
var maxLuminance:Double by parameters
init {
exposureBias = 1.0
maxLuminance = 1.0
}
}

View File

@@ -1,6 +1,7 @@
package org.openrndr.extra.fx.tonemap
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_uncharted2_tonemap
import org.openrndr.extra.fx.mppFilterShader
import org.openrndr.extra.parameters.Description
@@ -10,7 +11,7 @@ import org.openrndr.extra.parameters.DoubleParameter
* Uncharted 2 tonemap filter
*/
@Description("Uncharted 2 tonemap")
class Uncharted2Tonemap : Filter(mppFilterShader(fx_uncharted2_tonemap, "uncharted2-tonemap")) {
class Uncharted2Tonemap : Filter1to1(mppFilterShader(fx_uncharted2_tonemap, "uncharted2-tonemap")) {
@DoubleParameter("exposure bias", 0.0, 128.0)
var exposureBias:Double by parameters
init {

View File

@@ -1,10 +1,11 @@
package org.openrndr.extra.fx.transform
import org.openrndr.draw.Filter
import org.openrndr.draw.Filter1to1
import org.openrndr.extra.fx.fx_flip_vertically
import org.openrndr.extra.fx.mppFilterShader
/**
* Vertically flips in the input image
*/
class FlipVertically : Filter(mppFilterShader(fx_flip_vertically, "flip-vertically"))
class FlipVertically : Filter1to1(mppFilterShader(fx_flip_vertically, "flip-vertically"))