Skip to content

Commit

Permalink
added 345x912 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Zheng committed Feb 8, 2018
1 parent 6d5aa43 commit 2e59d14
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: clojure
script: lein test
jdk: oraclejdk8
3 changes: 2 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
clojure.core
[lucid.mind .& .> .? .* .% .%> .>var .>ns])]
:java-source-paths ["source/java"]
:source-paths ["source/clojure"])
:source-paths ["source/clojure"]
:test-paths ["test/clojure"])
Binary file added resources/lena-0345x0912.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions source/clojure/image_bench/grayscale.clj
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@
(CL/clWaitForEvents 1 events)

(cl/enq-read! cqueue p-dst (img/data-array output)))))))


(comment
(def lena (img/load-image "resources/lena-0500x0500.jpg"))

(def lena-gray (grayscale lena [8 8])))
23 changes: 23 additions & 0 deletions test/clojure/image_bench/sobel_test.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(ns image-bench.sobel-test
(:use hara.test)
(:require [image-bench.sobel :as sobel]
[image-bench.grayscale :as gray]
[image-bench.image :as img]))


;; PASSES
(fact "running a sobel kernel at [345, 912] [1 1]"

(def img (img/load-image "resources/lena-0345x0912.jpg"))

(gray/grayscale img)
=> java.awt.image.BufferedImage)


;; FAILS
(fact "running a sobel kernel at [345, 912] [13, 3]"

(def img (img/load-image "resources/lena-0345x0912.jpg"))

(gray/grayscale img [13 3])
=> java.awt.image.BufferedImage)

0 comments on commit 2e59d14

Please sign in to comment.