Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsacha committed Sep 20, 2019
2 parents 883daf8 + ff8ff14 commit 1193358
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
sudo: false
language: scala
scala:
- 2.12.8
- 2.12.10
- 2.13.1

jdk:
- oraclejdk8
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ijp-DeBayer2SX
[Bayer-pattern][bayer-filter] image to color image converters.

[![Build Status](https://travis-ci.org/ij-plugins/ijp-DeBayer2SX.svg?branch=master)](https://travis-ci.org/ij-plugins/ijp-DeBayer2SX) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sf.ij-plugins/ijp-DeBayer2SX_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sf.ij-plugins/ijp-DeBayer2SX_2.12)
[![Scaladoc](http://javadoc-badge.appspot.com/net.sf.ij-plugins/ijp-DeBayer2SX_2.12.svg?label=scaladoc)](http://javadoc-badge.appspot.com/net.sf.ij-plugins/ijp-DeBayer2SX_2.12)
[![Build Status](https://travis-ci.org/ij-plugins/ijp-DeBayer2SX.svg?branch=master)](https://travis-ci.org/ij-plugins/ijp-DeBayer2SX) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sf.ij-plugins/ijp-debayer2sx-core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sf.ij-plugins/ijp-debayer2sx-core_2.12)
[![Scaladoc](http://javadoc-badge.appspot.com/net.sf.ij-plugins/ijp-debayer2sx-core_2.12.svg?label=scaladoc)](http://javadoc-badge.appspot.com/net.sf.ij-plugins/ijp-debayer2sx-core_2.12)


Demasaicing (Bayer patter reconstruction) algorithms implemented, all support 8 bit and 16 bit input:
Expand All @@ -25,6 +25,14 @@ Plugins install by default under "plugins" > "IJ-Plugins"
* __Make Bayer__ - convert color image to a Bayer-pattern image.


## Using as library
`ijp-DeBayer2SX` can be used as a stand-alone library, add following dependency to your SBT:

```scala
"net.sf.ij-plugins" %% "ijp-debayer2sx-core" % _version_
```


## Developer Notes

The project is using SBT as the build system.
Expand Down
3 changes: 3 additions & 0 deletions build-extras.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ThisBuild / turbo := true

ThisBuild / useSuperShell := false
28 changes: 17 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import sbt.Keys.{licenses, startYear, version}

name := "ijp-debayer2sx"

val _version = "1.0.0"
val _version = "1.0.1-SNAPSHOT"

lazy val _scalaVersion = "2.12.8"
lazy val _scalaVersions = Seq("2.13.1", "2.12.10")
lazy val _scalaVersion = _scalaVersions.head

scalaVersion := _scalaVersion
publishArtifact := false
skip in publish := true

val commonSettings = Seq(
homepage := Some(new URL("https://github.com/ij-plugins/ijp-DeBayer2SX")),
Expand All @@ -19,24 +21,27 @@ val commonSettings = Seq(
organization := "net.sf.ij-plugins",
version := _version,
scalaVersion := _scalaVersion,
crossScalaVersions := _scalaVersions,
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-Xlint",
"-explaintypes",
"-target:jvm-1.8",
// "-target:jvm-1.8",
// "-opt:l:method",
),
javacOptions ++= Seq("-deprecation", "-Xlint", "-target", "1.8", "-source", "1.8"),
javacOptions ++= Seq("-deprecation", "-Xlint",
// "-target", "1.8", "-source", "1.8"
),
// Some dependencies like `javacpp` are packaged with maven-plugin packaging
classpathTypes += "maven-plugin",
libraryDependencies ++= Seq(
"net.imagej" % "ij" % "1.52k",
"org.scalatest" %% "scalatest" % "3.0.6" % "test",
"net.imagej" % "ij" % "1.52p",
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
),
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
"ImageJ Releases" at "http://maven.imagej.net/content/repositories/releases/",
// "ImageJ Releases" at "http://maven.imagej.net/content/repositories/releases/",
// Use local maven repo for local javacv builds
Resolver.mavenLocal
),
Expand Down Expand Up @@ -82,22 +87,23 @@ lazy val ijp_debayer2sx_core = project.in(file("ijp-debayer2sx-core"))
lazy val ijp_debayer2sx_plugins = project.in(file("ijp-debayer2sx-plugins"))
.settings(commonSettings,
name := "ijp-debayer2sx-plugins",
description := "IJP DeBayer2SX ImageJ Plugins",
publishArtifact := false)
description := "IJP DeBayer2SX ImageJ Plugins")
.dependsOn(ijp_debayer2sx_core)

lazy val ijp_debayer2sx_demos = project.in(file("ijp-debayer2sx-demos"))
.settings(commonSettings,
name := "ijp-debayer2sx-demos",
description := "IJP DeBayer2SX Demos",
publishArtifact := false)
publishArtifact := false,
skip in publish := true)
.dependsOn(ijp_debayer2sx_core)

lazy val ijp_debayer2sx_experimental = project.in(file("ijp-debayer2sx-experimental"))
.settings(commonSettings,
name := "ijp-debayer2sx-experimental",
description := "Experimental Features",
publishArtifact := false)
publishArtifact := false,
skip in publish := true)
.dependsOn(ijp_debayer2sx_core)

// Set the prompt (for this build) to include the project id.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Image/J Plugins
* Copyright (C) 2002-2018 Jarek Sacha
* Copyright (C) 2002-2019 Jarek Sacha
* Author's email: jpsacha at gmail [dot] com
*
* This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -138,7 +138,7 @@ class DDFAPDTest extends FlatSpec with BeforeAndAfter with Matchers {
243, 30, 198, 115, 133, 198, 180, 137, 112, 86, 26, 191, 96, 58, 36, 103, 76, 8, 64, 177, 154, 5, 232, 55, 176, 220, 189, 154, 10, 48, 250, 73,
139, 9, 130, 3, 198, 42, 152, 118, 21, 60, 245, 81, 67, 12, 129, 77, 166, 10, 226, 245, 92, 115, 146, 223, 163, 229, 114, 241, 120, 194, 23, 180,
64, 153, 7, 121, 30, 233, 192, 210, 144, 81, 39, 126, 61, 43, 156, 243, 228, 253, 50, 139, 34, 62, 85, 21, 186, 48, 181, 125, 38, 8, 169, 137,
148, 154, 253, 243, 160, 81, 127, 243, 138, 252, 39, 56, 159, 66, 180, 117, 220, 175, 31, 162, 233, 222, 245, 119, 220, 169, 241, 112, 253, 164, 154, 49,
148, 154, 253, 243, 160, 81, 127, 243, 138, 252, 39, 56, 159, 66, 180, 117, 220, 175, 31, 162, 233, 222, 245, 119, 220, 169, 241, 112, 253, 164, 154, 49
)
bay32x32 = new ShortProcessor(32, 32, pixels, null)

Expand All @@ -158,7 +158,7 @@ class DDFAPDTest extends FlatSpec with BeforeAndAfter with Matchers {
84, 0, 47, 0, 84, 0, 176, 0, 67, 0, 155, 0, 54, 0, 235, 0, 165, 0, 236, 0, 6, 0, 161, 0, 38, 0, 99, 0, 92, 0, 74, 0,
164, 0, 13, 0, 209, 0, 197, 0, 224, 0, 225, 0, 97, 0, 73, 0, 132, 0, 123, 0, 136, 0, 162, 0, 207, 0, 69, 0, 17, 0, 162, 0,
243, 0, 198, 0, 133, 0, 180, 0, 112, 0, 26, 0, 96, 0, 36, 0, 76, 0, 64, 0, 154, 0, 232, 0, 176, 0, 189, 0, 10, 0, 250, 0,
64, 0, 7, 0, 30, 0, 192, 0, 144, 0, 39, 0, 61, 0, 156, 0, 228, 0, 50, 0, 34, 0, 85, 0, 186, 0, 181, 0, 38, 0, 169, 0,
64, 0, 7, 0, 30, 0, 192, 0, 144, 0, 39, 0, 61, 0, 156, 0, 228, 0, 50, 0, 34, 0, 85, 0, 186, 0, 181, 0, 38, 0, 169, 0

)

Expand All @@ -178,7 +178,7 @@ class DDFAPDTest extends FlatSpec with BeforeAndAfter with Matchers {
84.0f, 65.5f, 47.0f, 65.5f, 84.0f, 130.0f, 176.0f, 121.5f, 67.0f, 111.0f, 155.0f, 104.5f, 54.0f, 144.5f, 235.0f, 200.0f, 165.0f, 200.5f, 236.0f, 121.0f, 6.0f, 83.5f, 161.0f, 99.5f, 38.0f, 68.5f, 99.0f, 95.5f, 92.0f, 83.0f, 74.0f, 74.0f,
164.0f, 88.5f, 13.0f, 111.0f, 209.0f, 203.0f, 197.0f, 210.5f, 224.0f, 224.5f, 225.0f, 161.0f, 97.0f, 85.0f, 73.0f, 102.5f, 132.0f, 127.5f, 123.0f, 129.5f, 136.0f, 149.0f, 162.0f, 184.5f, 207.0f, 138.0f, 69.0f, 43.0f, 17.0f, 89.5f, 162.0f, 162.0f,
243.0f, 220.5f, 198.0f, 165.5f, 133.0f, 156.5f, 180.0f, 146.0f, 112.0f, 69.0f, 26.0f, 61.0f, 96.0f, 66.0f, 36.0f, 56.0f, 76.0f, 70.0f, 64.0f, 109.0f, 154.0f, 193.0f, 232.0f, 204.0f, 176.0f, 182.5f, 189.0f, 99.5f, 10.0f, 130.0f, 250.0f, 250.0f,
64.0f, 35.5f, 7.0f, 18.5f, 30.0f, 111.0f, 192.0f, 168.0f, 144.0f, 91.5f, 39.0f, 50.0f, 61.0f, 108.5f, 156.0f, 192.0f, 228.0f, 139.0f, 50.0f, 42.0f, 34.0f, 59.5f, 85.0f, 135.5f, 186.0f, 183.5f, 181.0f, 109.5f, 38.0f, 103.5f, 169.0f, 169.0f,
64.0f, 35.5f, 7.0f, 18.5f, 30.0f, 111.0f, 192.0f, 168.0f, 144.0f, 91.5f, 39.0f, 50.0f, 61.0f, 108.5f, 156.0f, 192.0f, 228.0f, 139.0f, 50.0f, 42.0f, 34.0f, 59.5f, 85.0f, 135.5f, 186.0f, 183.5f, 181.0f, 109.5f, 38.0f, 103.5f, 169.0f, 169.0f
)

ghExpected = Array[Float](
Expand Down Expand Up @@ -213,7 +213,7 @@ class DDFAPDTest extends FlatSpec with BeforeAndAfter with Matchers {
243.0000f, 199.2500f, 198.0000f, 166.0000f, 133.0000f, 192.5000f, 180.0000f, 143.5000f, 112.0000f, 30.0000f, 26.0000f, 120.5000f, 96.0000f, 21.5000f, 36.0000f, 91.0000f, 76.0000f, 4.0000f, 64.0000f, 194.2500f, 154.0000f, 137.5000f, 232.0000f, 175.2500f, 176.0000f, 240.2500f, 189.0000f, 109.5000f, 10.0000f, 97.2500f, 250.0000f, 262.5000f,
13.5000f, 9.0000f, -13.2500f, 3.0000f, 51.0000f, 42.0000f, 101.2500f, 118.0000f, 0.2500f, 60.0000f, 171.0000f, 81.0000f, -13.5000f, 12.0000f, 50.7500f, 77.0000f, 37.7500f, 10.0000f, 176.0000f, 245.0000f, 133.0000f, 115.0000f, 178.2500f, 223.0000f, 242.5000f, 229.0000f, 221.2500f, 241.0000f, 243.2500f, 194.0000f, 162.7500f, 180.0000f,
64.0000f, 43.5000f, 7.0000f, -17.5000f, 30.0000f, 144.7500f, 192.0000f, 194.5000f, 144.0000f, 48.0000f, 39.0000f, 82.0000f, 61.0000f, 37.7500f, 156.0000f, 239.5000f, 228.0000f, 170.0000f, 50.0000f, 32.7500f, 34.0000f, 50.5000f, 85.0000f, 118.5000f, 186.0000f, 171.0000f, 181.0000f, 158.0000f, 38.0000f, 42.0000f, 169.0000f, 233.5000f,
101.5000f, 154.0000f, 248.0000f, 243.0000f, 147.0000f, 81.0000f, 151.0000f, 243.0000f, 275.0000f, 252.0000f, 99.2500f, 56.0000f, 85.7500f, 66.0000f, 86.7500f, 117.0000f, 203.2500f, 175.0000f, 70.7500f, 162.0000f, 239.5000f, 222.0000f, 179.7500f, 119.0000f, 132.5000f, 169.0000f, 142.7500f, 112.0000f, 165.7500f, 164.0000f, 81.7500f, 49.0000f,
101.5000f, 154.0000f, 248.0000f, 243.0000f, 147.0000f, 81.0000f, 151.0000f, 243.0000f, 275.0000f, 252.0000f, 99.2500f, 56.0000f, 85.7500f, 66.0000f, 86.7500f, 117.0000f, 203.2500f, 175.0000f, 70.7500f, 162.0000f, 239.5000f, 222.0000f, 179.7500f, 119.0000f, 132.5000f, 169.0000f, 142.7500f, 112.0000f, 165.7500f, 164.0000f, 81.7500f, 49.0000f
)

gvExpected = Array[Float](
Expand Down Expand Up @@ -248,7 +248,7 @@ class DDFAPDTest extends FlatSpec with BeforeAndAfter with Matchers {
243.0000f, 46.7500f, 198.0000f, 19.2500f, 133.0000f, 106.5000f, 180.0000f, 156.7500f, 112.0000f, 8.2500f, 26.0000f, 174.2500f, 96.0000f, 69.2500f, 36.0000f, 142.2500f, 76.0000f, 55.7500f, 64.0000f, 219.7500f, 154.0000f, 50.0000f, 232.0000f, 216.2500f, 176.0000f, 260.5000f, 189.0000f, 262.7500f, 10.0000f, 214.5000f, 250.0000f, 194.2500f,
175.2500f, 9.0000f, 65.5000f, 3.0000f, 106.5000f, 42.0000f, 177.2500f, 118.0000f, 100.2500f, 60.0000f, 136.7500f, 81.0000f, 65.7500f, 12.0000f, 64.7500f, 77.0000f, 164.5000f, 10.0000f, 154.2500f, 245.0000f, 61.0000f, 115.0000f, 132.0000f, 223.0000f, 167.0000f, 229.0000f, 126.2500f, 241.0000f, 7.5000f, 194.0000f, 123.0000f, 180.0000f,
64.0000f, 112.2500f, 7.0000f, 124.5000f, 30.0000f, 70.2500f, 192.0000f, 198.7500f, 144.0000f, 154.7500f, 39.0000f, 52.2500f, 61.0000f, 35.2500f, 156.0000f, 132.0000f, 228.0000f, 153.7500f, 50.0000f, 194.0000f, 34.0000f, 182.7500f, 85.0000f, 162.5000f, 186.0000f, 156.0000f, 181.0000f, 169.2500f, 38.0000f, 169.0000f, 169.0000f, 130.5000f,
68.5000f, 154.0000f, 68.5000f, 243.0000f, 11.0000f, 81.0000f, 179.5000f, 243.0000f, 202.5000f, 252.0000f, -64.0000f, 56.0000f, 107.0000f, 66.0000f, 181.5000f, 117.0000f, 255.0000f, 175.0000f, -47.5000f, 162.0000f, 104.5000f, 222.0000f, 134.5000f, 119.0000f, 214.5000f, 169.0000f, 244.5000f, 112.0000f, 104.5000f, 164.0000f, 234.5000f, 49.0000f,
68.5000f, 154.0000f, 68.5000f, 243.0000f, 11.0000f, 81.0000f, 179.5000f, 243.0000f, 202.5000f, 252.0000f, -64.0000f, 56.0000f, 107.0000f, 66.0000f, 181.5000f, 117.0000f, 255.0000f, 175.0000f, -47.5000f, 162.0000f, 104.5000f, 222.0000f, 134.5000f, 119.0000f, 214.5000f, 169.0000f, 244.5000f, 112.0000f, 104.5000f, 164.0000f, 234.5000f, 49.0000f
)

// dstGExpected = Array[Float](
Expand Down Expand Up @@ -283,7 +283,7 @@ class DDFAPDTest extends FlatSpec with BeforeAndAfter with Matchers {
// 243, 47, 198, 166, 133, 193, 180, 144, 112, 30, 26, 121, 96, 22, 36, 91, 76, 4, 64, 220, 154, 50, 232, 216, 176, 261, 189, 263, 10, 215, 250, 194,
// 175, 9, 0, 3, 51, 42, 177, 118, 0, 60, 171, 81, 0, 12, 51, 77, 38, 10, 176, 245, 133, 115, 178, 223, 167, 229, 221, 241, 243, 194, 163, 180,
// 64, 44, 7, 0, 30, 70, 192, 199, 144, 48, 39, 82, 61, 38, 156, 240, 228, 170, 50, 194, 34, 183, 85, 163, 186, 156, 181, 169, 38, 169, 169, 131,
// 69, 154, 248, 243, 147, 81, 151, 243, 275, 252, 99, 56, 86, 66, 87, 117, 203, 175, 71, 162, 240, 222, 180, 119, 133, 169, 143, 112, 166, 164, 82, 49,
// 69, 154, 248, 243, 147, 81, 151, 243, 275, 252, 99, 56, 86, 66, 87, 117, 203, 175, 71, 162, 240, 222, 180, 119, 133, 169, 143, 112, 166, 164, 82, 49
// )

// interpDirExpected = Array[Int](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class DeBayer2Plugin extends PlugIn {
// Decode values
config = DeBayer2Config(
mosaicOrder = MosaicOrder.withName(gd.getNextChoice),
demosaicing = Demosaicing.withName(gd.getNextChoice),
demosaicing = Demosaicing.withName(gd.getNextChoice)
)

true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/*
* Image/J Plugins
* Copyright (C) 2002-2019 Jarek Sacha
* Author's email: jpsacha at gmail [dot] com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Latest release available at http://sourceforge.net/projects/ij-plugins/
*/

package net.sf.ijplugins.util

import java.awt._
Expand All @@ -11,6 +33,8 @@ import javax.swing.event.HyperlinkEvent.EventType._
import javax.swing.event.{HyperlinkEvent, HyperlinkListener}
import javax.swing.text.html.HTMLDocument

import scala.util.control.NonFatal

/**
*/
object IJPUtils {
Expand All @@ -30,7 +54,7 @@ object IJPUtils {
}
return new ImageIcon(url)
} catch {
case t: Throwable =>
case NonFatal(t) =>
IJ.log("Error loading icon from resource '" + path + "' for class '" + aClass.getName + "'. \n" + t.getMessage)
}
null
Expand All @@ -54,7 +78,7 @@ object IJPUtils {
val bodyRule = "body { font-family: " + font.getFamily + "; " + "font-size: " + font.getSize + "pt; }"
htmlDocument.getStyleSheet.addRule(bodyRule)
pane.addHyperlinkListener(new HyperlinkListener() {
def hyperlinkUpdate(e: HyperlinkEvent) {
def hyperlinkUpdate(e: HyperlinkEvent): Unit = {
if (e.getEventType == ACTIVATED) {
try {
Desktop.getDesktop.browse(e.getURL.toURI)
Expand Down
3 changes: 1 addition & 2 deletions project/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@
#
# Latest release available at http://sourceforge.net/projects/ij-plugins/
#

sbt.version=1.2.8
sbt.version=1.3.0
2 changes: 1 addition & 1 deletion project/sbt-sonatype.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// [https://github.com/xerial/sbt-sonatype]
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.4")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.7")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")

0 comments on commit 1193358

Please sign in to comment.