Skip to content

Commit 43c37d5

Browse files
committed
Merge branch 'master' into teh/latency
2 parents 62b5617 + c8a6480 commit 43c37d5

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

.github/workflows/UnitTest.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ jobs:
3838
${{ runner.os }}-test-
3939
${{ runner.os }}-
4040
41+
- name: "Compat fix for Julia < v1.3.0"
42+
if: ${{ matrix.julia-version == '1.0' }}
43+
run: |
44+
using Pkg
45+
Pkg.add([
46+
PackageSpec(name="FFTW", version="1.1"),
47+
PackageSpec(name="AbstractFFTs", version="0.5")
48+
])
49+
shell: julia --project=. --startup=no --color=yes {0}
4150
- name: "Unit Test"
4251
uses: julia-actions/julia-runtest@master
4352

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ ColorVectorSpace = "0.9"
2020
Colors = "0.12"
2121
FixedPointNumbers = "0.8"
2222
Graphics = "0.4, 1.0"
23-
MappedArrays = "0.2, 0.3"
24-
MosaicViews = "0.3.0"
23+
MappedArrays = "0.2, 0.3, 0.4"
24+
MosaicViews = "0.3.3"
2525
OffsetArrays = "0.8, 0.9, 0.10, 0.11, 1.0.1"
2626
PaddedViews = "0.5.8"
2727
Reexport = "0.2, 1.0"

src/ImageCore.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ _filltype(::Type{FC}, ::Type{C}) where {FC<:TransparentColor, C<:AbstractGray} =
154154
_filltype(::Type{FC}, ::Type{C}) where {FC<:TransparentColor, C<:Color3} =
155155
alphacolor(C){promote_type(eltype(FC), eltype(C))}
156156

157+
158+
# MosaicViews support (require MosaicViews >= v0.3.0)
159+
MosaicViews.promote_wrapped_type(::Type{T}, ::Type{S}) where {T<:Colorant,S<:Colorant} = promote_type(T, S)
160+
MosaicViews.promote_wrapped_type(::Type{T}, ::Type{S}) where {T,S<:Colorant} = S === Union{} ? T : base_colorant_type(S){MosaicViews.promote_wrapped_type(T, eltype(S))}
161+
MosaicViews.promote_wrapped_type(::Type{T}, ::Type{S}) where {T<:Colorant,S} = MosaicViews.promote_wrapped_type(S, T)
162+
157163
# Support transpose
158164
Base.transpose(a::AbstractMatrix{C}) where {C<:Colorant} = permutedims(a, (2,1))
159165
function Base.transpose(a::AbstractVector{C}) where C<:Colorant
@@ -164,10 +170,6 @@ function Base.transpose(a::AbstractVector{C}) where C<:Colorant
164170
out
165171
end
166172

167-
MosaicViews.promote_wrapped_type(::Type{T}, ::Type{S}) where {T<:Colorant,S<:Colorant} = promote_type(T, S)
168-
MosaicViews.promote_wrapped_type(::Type{T}, ::Type{S}) where {T,S<:Colorant} = S === Union{} ? T : base_colorant_type(S){MosaicViews.promote_wrapped_type(T, eltype(S))}
169-
MosaicViews.promote_wrapped_type(::Type{T}, ::Type{S}) where {T<:Colorant,S} = MosaicViews.promote_wrapped_type(S, T)
170-
171173
if VERSION >= v"1.4.2" # work around https://github.com/JuliaLang/julia/issues/34121
172174
include("precompile.jl")
173175
_precompile_()

test/views.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ end
209209
A[:, :, 1] .= RGB(1., 0., 0.)
210210
A[:, :, 2] .= RGB(0., 1., 0.)
211211
A[:, :, 3] .= RGB(0., 0., 1.)
212-
out = mosaicview(A) |> collect
212+
out = mosaic(A) |> collect
213213
@test_reference "references/mosaicviews/3d_opaque_1.png" out by=isequal
214-
out = mosaicview(A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
214+
out = mosaic(A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
215215
@test_reference "references/mosaicviews/3d_opaque_2.png" out by=isequal
216-
out = mosaicview(A; npad=2, fillvalue=Gray(0.), nrow=2, rowmajor=true) |> collect
216+
out = mosaic(A; npad=2, fillvalue=Gray(0.), nrow=2, rowmajor=true) |> collect
217217
@test_reference "references/mosaicviews/3d_opaque_3.png" out by=isequal
218218
out = mosaic(A, A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
219219
@test_reference "references/mosaicviews/3d_opaque_4.png" out by=isequal
@@ -222,11 +222,11 @@ end
222222
A[:, :, 1] .= RGBA(1., 0., 0.)
223223
A[:, :, 2] .= RGBA(0., 1., 0.)
224224
A[:, :, 3] .= RGBA(0., 0., 1.)
225-
out = mosaicview(A) |> collect
225+
out = mosaic(A) |> collect
226226
@test_reference "references/mosaicviews/3d_transparent_1.png" out by=isequal
227-
out = mosaicview(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2) |> collect
227+
out = mosaic(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2) |> collect
228228
@test_reference "references/mosaicviews/3d_transparent_2.png" out by=isequal
229-
out = mosaicview(A; npad=2, fillvalue=GrayA(0.), nrow=2, rowmajor=true) |> collect
229+
out = mosaic(A; npad=2, fillvalue=GrayA(0.), nrow=2, rowmajor=true) |> collect
230230
@test_reference "references/mosaicviews/3d_transparent_3.png" out by=isequal
231231
out = mosaic(A, A; npad=2, fillvalue=GrayA(0.), nrow=2) |> collect
232232
@test_reference "references/mosaicviews/3d_transparent_4.png" out by=isequal
@@ -237,11 +237,11 @@ end
237237
A[1, :, 1, 1] .= RGB(1., 0., 0.)
238238
A[:, :, 1, 2] .= RGB(0., 1., 0.)
239239
A[:, :, 2, 1] .= RGB(0., 0., 1.)
240-
out = mosaicview(A) |> collect
240+
out = mosaic(A) |> collect
241241
@test_reference "references/mosaicviews/4d_opaque_1.png" out by=isequal
242-
out = mosaicview(A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
242+
out = mosaic(A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
243243
@test_reference "references/mosaicviews/4d_opaque_2.png" out by=isequal
244-
out = mosaicview(A; npad=2, fillvalue=Gray(0.), nrow=2, rowmajor=true) |> collect
244+
out = mosaic(A; npad=2, fillvalue=Gray(0.), nrow=2, rowmajor=true) |> collect
245245
@test_reference "references/mosaicviews/4d_opaque_3.png" out by=isequal
246246
out = mosaic(A, A; npad=2, fillvalue=Gray(0.), nrow=2) |> collect
247247
@test_reference "references/mosaicviews/4d_opaque_4.png" out by=isequal
@@ -250,11 +250,11 @@ end
250250
A[1, :, 1, 1] .= RGBA(1., 0., 0.)
251251
A[:, :, 1, 2] .= RGBA(0., 1., 0.)
252252
A[:, :, 2, 1] .= RGBA(0., 0., 1.)
253-
out = mosaicview(A) |> collect
253+
out = mosaic(A) |> collect
254254
@test_reference "references/mosaicviews/4d_transparent_1.png" out by=isequal
255-
out = mosaicview(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2) |> collect
255+
out = mosaic(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2) |> collect
256256
@test_reference "references/mosaicviews/4d_transparent_2.png" out by=isequal
257-
out = mosaicview(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2, rowmajor=true) |> collect
257+
out = mosaic(A; npad=2, fillvalue=GrayA(0., 0.), nrow=2, rowmajor=true) |> collect
258258
@test_reference "references/mosaicviews/4d_transparent_3.png" out by=isequal
259259
out = mosaic(A, A; npad=2, fillvalue=GrayA(0.), nrow=2) |> collect
260260
@test_reference "references/mosaicviews/4d_transparent_4.png" out by=isequal

0 commit comments

Comments
 (0)