Skip to content

Commit

Permalink
expand TODO based on comment
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed May 7, 2024
1 parent 270e59f commit 9a290c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/imfilter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -878,11 +878,17 @@ function filtfft(A, krn, planned_rfft1::Function, planned_rfft2::Function, plann
B .*= conj!(complex(planned_rfft2(krn)))
return real(planned_irfft(complex(B)))
end
# TODO: this does not work. See TODO below
# TODO: this Colorant method does not work. See TODO below
function filtfft(A::AbstractArray{C}, krn, planned_rfft1::Function, planned_rfft2::Function, planned_irfft::Function) where {C<:Colorant}
Av, dims = channelview_dims(A)
kernrs = kreshape(C, krn)
B = complex(planned_rfft1(Av, dims)) # TODO: dims is not supported by planned_rfft1
# Quoting Tim Holy in https://github.com/JuliaImages/ImageFiltering.jl/pull/271/files#r1559210348
# I don't think dims can be a point of flexibility: these plans are specific to the
# memory layout of the array. (The planning explores various implementations and picks
# the fastest discovered; performance is strongly dependent on memory layout, so the
# choice for one layout may not be the same as another.) You'd have to create a plan
# specifically to the colorant array-type.
B .*= conj!(complex(planned_rfft2(kernrs)))
Avf = real(planned_irfft(complex(B)))
return colorview(base_colorant_type(C){eltype(Avf)}, Avf)
Expand Down

0 comments on commit 9a290c9

Please sign in to comment.