View gist:0a179ba36ce98eac17a3a5cccbc8c186
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("boxBlurKernel should return the correct value on an interior pixel " + | |
"of a 3x3 image with radius 1") { | |
val src = new Img(3, 3) | |
src(0, 0) = 0; src(1, 0) = 1; src(2, 0) = 2 | |
src(0, 1) = 3; src(1, 1) = 4; src(2, 1) = 5 | |
src(0, 2) = 6; src(1, 2) = 7; src(2, 2) = 8 | |
def check(x: Int, y: Int, expected: Int) = | |
assertResult(expected, s"boxBlurKernel($x, $y, 1)")( boxBlurKernel(src, x, y, 1) ) |