Skip to content

Commit b381505

Browse files
committed
test: add tests
1 parent 47fdbc8 commit b381505

File tree

12 files changed

+211
-19
lines changed

12 files changed

+211
-19
lines changed

R/color-manip.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ contrast <- function(nr, intensity) {
6464
#' @export
6565
duotone <- function(nr, color_a = "yellow", color_b = "navy", gamma = 2.2) {
6666
sz <- dim(nr)
67-
color_a <- fill_with(color_a, sz[1], sz[2]) |> nr_to_rgba("color_a")
68-
color_b <- fill_with(color_b, sz[1], sz[2]) |> nr_to_rgba("color_b")
67+
color_a <- fill_with(color_a, sz[2], sz[1]) |> nr_to_rgba("color_a")
68+
color_b <- fill_with(color_b, sz[2], sz[1]) |> nr_to_rgba("color_b")
6969
ret <- nr_to_rgba(nr, "nr")
7070
luminance <- clamp(gray(ret[1:3, ])^(1 / gamma), 0, 1)
7171
rgb <- mix(color_a[1:3, ], color_b[1:3, ], luminance)
@@ -124,8 +124,8 @@ invert <- function(nr) {
124124
#' @export
125125
linocut <- function(nr, ink = "navy", paper = "snow", threshold = 0.4) {
126126
sz <- dim(nr)
127-
ink <- fill_with(ink, sz[1], sz[2]) |> nr_to_rgba("ink")
128-
paper <- fill_with(paper, sz[1], sz[2]) |> nr_to_rgba("paper")
127+
ink <- fill_with(ink, sz[2], sz[1]) |> nr_to_rgba("ink")
128+
paper <- fill_with(paper, sz[2], sz[1]) |> nr_to_rgba("paper")
129129
ret <- nr_to_rgba(nr, "nr")
130130
luminance <- step(gray(ret[1:3, ]), threshold)
131131
rgb <- mix(paper[1:3, ], ink[1:3, ], luminance)
File renamed without changes.
File renamed without changes.

tests/testthat/_snaps/effects/lineweave.svg

Lines changed: 23 additions & 0 deletions
Loading

tests/testthat/_snaps/others/detail-enhance.svg

Lines changed: 23 additions & 0 deletions
Loading

tests/testthat/_snaps/others/histogram-eq.svg

Lines changed: 23 additions & 0 deletions
Loading

tests/testthat/_snaps/others/oilpaint.svg

Lines changed: 23 additions & 0 deletions
Loading

tests/testthat/_snaps/others/pencil-sketch.svg

Lines changed: 23 additions & 0 deletions
Loading

tests/testthat/_snaps/others/stylization.svg

Lines changed: 23 additions & 0 deletions
Loading

tests/testthat/test-diffusion.R

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)