Skip to content

Commit 9a290c9

Browse files
expand TODO based on comment
1 parent 270e59f commit 9a290c9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/imfilter.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,11 +878,17 @@ function filtfft(A, krn, planned_rfft1::Function, planned_rfft2::Function, plann
878878
B .*= conj!(complex(planned_rfft2(krn)))
879879
return real(planned_irfft(complex(B)))
880880
end
881-
# TODO: this does not work. See TODO below
881+
# TODO: this Colorant method does not work. See TODO below
882882
function filtfft(A::AbstractArray{C}, krn, planned_rfft1::Function, planned_rfft2::Function, planned_irfft::Function) where {C<:Colorant}
883883
Av, dims = channelview_dims(A)
884884
kernrs = kreshape(C, krn)
885885
B = complex(planned_rfft1(Av, dims)) # TODO: dims is not supported by planned_rfft1
886+
# Quoting Tim Holy in https://github.com/JuliaImages/ImageFiltering.jl/pull/271/files#r1559210348
887+
# I don't think dims can be a point of flexibility: these plans are specific to the
888+
# memory layout of the array. (The planning explores various implementations and picks
889+
# the fastest discovered; performance is strongly dependent on memory layout, so the
890+
# choice for one layout may not be the same as another.) You'd have to create a plan
891+
# specifically to the colorant array-type.
886892
B .*= conj!(complex(planned_rfft2(kernrs)))
887893
Avf = real(planned_irfft(complex(B)))
888894
return colorview(base_colorant_type(C){eltype(Avf)}, Avf)

0 commit comments

Comments
 (0)