Skip to content

Commit

Permalink
Add support for picture effects based on ImageOp.
Browse files Browse the repository at this point in the history
  • Loading branch information
litan committed Mar 2, 2020
1 parent 260483b commit f1f5291
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/main/scala/net/kogics/kojo/lite/Builtins.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import javax.swing.JComponent
import scala.language.implicitConversions
import scala.swing.Graphics2D

import com.jhlabs.image.AbstractBufferedImageOp
import com.jhlabs.image.LightFilter.Light

import net.kogics.kojo.mathworld.MathWorld
Expand Down Expand Up @@ -392,6 +393,13 @@ Here's a partial list of the available commands:
val weave = picture.weave _
def effect(name: Symbol, props: Tuple2[Symbol, Any]*) = picture.effect(name, props: _*)
def effect(filter: BufferedImageOp) = picture.ApplyFilterc(filter)
type ImageOp = picture.ImageOp
def effect(filterOp: ImageOp) = {
val filterOp2 = new AbstractBufferedImageOp {
def filter(src: BufferedImage, dest: BufferedImage) = filterOp.filter(src)
}
picture.ApplyFilterc(filterOp2)
}

// put api functions here to enable code completion right from function definitions
def transform(fn: Picture => Unit) = preDrawTransform(fn)
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/net/kogics/kojo/lite/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package net.kogics.kojo.lite
object Versions {
val KojoMajorVersion = "2.7"
val KojoVersion = "2.7.11"
val KojoRevision = "r15"
val KojoBuildDate = "25 February 2020"
val KojoRevision = "r16"
val KojoBuildDate = "3 March 2020"
val JavaVersion = {
val jrv = System.getProperty("java.runtime.version")
val arch = System.getProperty("os.arch")
Expand Down

0 comments on commit f1f5291

Please sign in to comment.