@@ -359,7 +359,7 @@ for f in (:closing, :opening)
359
359
@eval begin
360
360
# Provide destination and workspace.
361
361
function $f (A:: AbstractArray{<:Any,N} ,
362
- B:: Union{Window{N},AbstractArray{<:Any,N} } = 3 ; kwds... ) where {N}
362
+ B:: Kernel{N } = 3 ; kwds... ) where {N}
363
363
return $ f! (similar (A), similar (A), A, B; kwds... )
364
364
end
365
365
@@ -411,7 +411,7 @@ See also [`top_hat`](@ref) for more details.
411
411
function top_hat! (dst:: AbstractArray{<:Any,N} ,
412
412
wrk:: AbstractArray{<:Any,N} ,
413
413
A:: AbstractArray{<:Any,N} ,
414
- B:: Union{Window{N},AbstractArray{<:Any,N} } ; kwds... ) where {N}
414
+ B:: Kernel{N } ; kwds... ) where {N}
415
415
opening! (dst, wrk, A, B; kwds... )
416
416
@inbounds for i in eachindex (dst, A)
417
417
dst[i] = A[i] - dst[i]
@@ -453,10 +453,8 @@ different arrays. The destination `dst` is returned.
453
453
See also [`bottom_hat`](@ref) for more details.
454
454
455
455
"""
456
- function bottom_hat! (dst:: AbstractArray{<:Any,N} ,
457
- wrk:: AbstractArray{<:Any,N} ,
458
- A:: AbstractArray{<:Any,N} ,
459
- B:: Union{Window{N},AbstractArray{<:Any,N}} ; kwds... ) where {N}
456
+ function bottom_hat! (dst:: AbstractArray{<:Any,N} , wrk:: AbstractArray{<:Any,N} ,
457
+ A:: AbstractArray{<:Any,N} , B:: Kernel{N} = 3 ; kwds... ) where {N}
460
458
closing! (dst, wrk, A, B; kwds... )
461
459
@inbounds for i in eachindex (dst, A)
462
460
dst[i] -= A[i]
@@ -471,13 +469,9 @@ for (f, pf!) in ((:top_hat, :(closing!)),
471
469
@eval begin
472
470
# Provide destination and workspace. Out-of-place top/bottom hat filters require 2
473
471
# allocations without a pre-filtering, 3 allocations with a pre-filtering.
474
- function $f (A:: AbstractArray{<:Any,N} ,
475
- B:: Union{Window{N},AbstractArray{<:Any,N}} = 3 ; kwds... ) where {N}
476
- return $ f! (similar (A), similar (A), A, B; kwds... )
477
- end
478
- function $f (A:: AbstractArray{<:Any,N} ,
479
- B:: Union{Window{N},AbstractArray{<:Any,N}} ,
480
- C:: Union{Window{N},AbstractArray{<:Any,N}} ;
472
+ $ f (A:: AbstractArray{<:Any,N} , B:: Kernel{N} = 3 ; kwds... ) where {N} =
473
+ $ f! (similar (A), similar (A), A, B; kwds... )
474
+ function $f (A:: AbstractArray{<:Any,N} , B:: Kernel{N} , C:: Kernel{N} ;
481
475
order:: Union{FilterOrdering,NTuple{2,FilterOrdering}} = FORWARD_FILTER,
482
476
kwds... ) where {N}
483
477
B_order = order isa FilterOrdering ? order : order[1 ]
0 commit comments