Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name = "ImageCore"
uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534"
version = "0.8.12"
version = "0.8.13"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
Graphics = "a2bd30eb-e257-5431-a919-1863eab51364"
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
MosaicViews = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
PaddedViews = "5432bcbf-9aad-5242-b902-cca2824c8663"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Expand All @@ -17,6 +18,7 @@ Colors = "0.9, 0.10, 0.11, 0.12"
FixedPointNumbers = "0.6.1, 0.7, 0.8"
Graphics = "0.4, 1.0"
MappedArrays = "0.2"
MosaicViews = "0.2"
OffsetArrays = "0.8, 0.9, 0.10, 0.11, 1.0.1"
PaddedViews = "0.5.4"
Reexport = "0.2"
Expand All @@ -26,9 +28,11 @@ julia = "1"
[extras]
ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["ColorVectorSpace", "FFTW", "Random", "Statistics", "Test"]
test = ["ColorVectorSpace", "FFTW", "ImageMagick", "Random", "ReferenceTests", "Statistics", "Test"]
1 change: 1 addition & 0 deletions src/ImageCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if !isdefined(ColorTypes, :XRGB)
const RGBX = RGB4
end

@reexport using MosaicViews
@reexport using PaddedViews
using MappedArrays, Graphics
using OffsetArrays # for show.jl
Expand Down
Binary file added test/references/mosaicviews/2d_opaque_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/2d_opaque_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/2d_opaque_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/2d_transparent_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/2d_transparent_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/2d_transparent_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/3d_opaque_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/3d_opaque_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/3d_opaque_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/3d_opaque_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/3d_transparent_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/3d_transparent_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/3d_transparent_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/3d_transparent_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/4d_opaque_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/4d_opaque_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/4d_opaque_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/4d_opaque_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/4d_transparent_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/4d_transparent_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/4d_transparent_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/references/mosaicviews/4d_transparent_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module ImageCoreTests

using ImageCore, Test
using ImageCore, Test, ReferenceTests

# If we've run the tests previously, there might be ambiguities from other packages
if :StatsBase ∉ map(x->Symbol(string(x)), values(Base.loaded_modules))
Expand Down
81 changes: 81 additions & 0 deletions test/views.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,87 @@ end
@test axes(A) == (Base.OneTo(2),Base.OneTo(2))
end

@testset "mosaicviews" begin
# only test image cases
@testset "2D inputs" begin
A1 = fill(Gray(1.), 2, 2)
A2 = fill(RGB(1., 0., 0.), 3, 3)
A3 = fill(RGB(0., 1., 0.), 3, 3)
out = mosaicview(A1, A2, A3) |> collect
@test_reference "references/mosaicviews/2d_opaque_1.png" out by=isequal
out = mosaicview(A1, A2, A3; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
@test_reference "references/mosaicviews/2d_opaque_2.png" out by=isequal
out = mosaicview(A1, A2, A3; npad=2, fillvalue=Gray(0.), nrow=2, rowmajor=true) |> collect
@test_reference "references/mosaicviews/2d_opaque_3.png" out by=isequal

A1 = fill(GrayA(1.), 2, 2)
A2 = fill(RGBA(1., 0., 0.), 3, 3)
A3 = fill(RGBA(0., 1., 0.), 3, 3)
out = mosaicview(A1, A2, A3) |> collect
@test_reference "references/mosaicviews/2d_transparent_1.png" out by=isequal
out = mosaicview(A1, A2, A3; npad=2, fillvalue=GrayA(0., 0.), nrow=2) |> collect
@test_reference "references/mosaicviews/2d_transparent_2.png" out by=isequal
out = mosaicview(A1, A2, A3; npad=2, fillvalue=GrayA(0., 0.), nrow=2, rowmajor=true) |> collect
@test_reference "references/mosaicviews/2d_transparent_3.png" out by=isequal
end

@testset "3D inputs" begin
A = fill(RGB(0., 0., 0.), 2, 2, 3)
A[:, :, 1] .= RGB(1., 0., 0.)
A[:, :, 2] .= RGB(0., 1., 0.)
A[:, :, 3] .= RGB(0., 0., 1.)
out = mosaicview(A) |> collect
@test_reference "references/mosaicviews/3d_opaque_1.png" out by=isequal
out = mosaicview(A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
@test_reference "references/mosaicviews/3d_opaque_2.png" out by=isequal
out = mosaicview(A; npad=2, fillvalue=Gray(0.), nrow=2, rowmajor=true) |> collect
@test_reference "references/mosaicviews/3d_opaque_3.png" out by=isequal
out = mosaicview(A, A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
@test_reference "references/mosaicviews/3d_opaque_4.png" out by=isequal

A = fill(RGBA(0., 0., 0.), 2, 2, 3)
A[:, :, 1] .= RGBA(1., 0., 0.)
A[:, :, 2] .= RGBA(0., 1., 0.)
A[:, :, 3] .= RGBA(0., 0., 1.)
out = mosaicview(A) |> collect
@test_reference "references/mosaicviews/3d_transparent_1.png" out by=isequal
out = mosaicview(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2) |> collect
@test_reference "references/mosaicviews/3d_transparent_2.png" out by=isequal
out = mosaicview(A; npad=2, fillvalue=GrayA(0.), nrow=2, rowmajor=true) |> collect
@test_reference "references/mosaicviews/3d_transparent_3.png" out by=isequal
out = mosaicview(A, A; npad=2, fillvalue=GrayA(0.), nrow=2) |> collect
@test_reference "references/mosaicviews/3d_transparent_4.png" out by=isequal
end

@testset "4D inputs" begin
A = fill(RGB(0., 0., 0.), 2, 2, 2, 2)
A[1, :, 1, 1] .= RGB(1., 0., 0.)
A[:, :, 1, 2] .= RGB(0., 1., 0.)
A[:, :, 2, 1] .= RGB(0., 0., 1.)
out = mosaicview(A) |> collect
@test_reference "references/mosaicviews/4d_opaque_1.png" out by=isequal
out = mosaicview(A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
@test_reference "references/mosaicviews/4d_opaque_2.png" out by=isequal
out = mosaicview(A; npad=2, fillvalue=Gray(0.), nrow=2, rowmajor=true) |> collect
@test_reference "references/mosaicviews/4d_opaque_3.png" out by=isequal
out = mosaicview(A, A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
@test_reference "references/mosaicviews/4d_opaque_4.png" out by=isequal

A = fill(RGBA(0., 0., 0.), 2, 2, 2, 2)
A[1, :, 1, 1] .= RGBA(1., 0., 0.)
A[:, :, 1, 2] .= RGBA(0., 1., 0.)
A[:, :, 2, 1] .= RGBA(0., 0., 1.)
out = mosaicview(A) |> collect
@test_reference "references/mosaicviews/4d_transparent_1.png" out by=isequal
out = mosaicview(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2) |> collect
@test_reference "references/mosaicviews/4d_transparent_2.png" out by=isequal
out = mosaicview(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2, rowmajor=true) |> collect
@test_reference "references/mosaicviews/4d_transparent_3.png" out by=isequal
out = mosaicview(A, A; npad=2, fillvalue=GrayA(0.), nrow=2) |> collect
@test_reference "references/mosaicviews/4d_transparent_4.png" out by=isequal
end
end

@testset "PaddedViews" begin
# don't promote to Colorant if it's a numerical array
@test @inferred(filltype(Gray{N0f8}, Float32)) === Float32
Expand Down