You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a situation in which @which reports an available method, but actually trying to use the method results in a MethodError. I'm probably doing something wrong, but for the life of me I can't figure out what. This happens on both master and 0.3.
julia>using Images, TestImages, Color
julia> img =testimage("lighthouse")
RGB Image with:
data:768x512 Array{RGB{UfixedBase{Uint8,8}},2}
properties:
IMcs: sRGB
spatialorder: x y
pixelspacing:11
julia>@whichconvert(Image{RGB}, img)
convert{Cdest<:Union(AbstractAlphaColorValue{C<:ColorValue{T},T<:Real},ColorValue{T}),Csrc<:Union(AbstractAlphaColorValue{C<:ColorValue{T},T<:Real},ColorValue{T})}(::Type{Image{Cdest<:Union(AbstractAlphaColorValue{C<:ColorValue{T},T<:Real},ColorValue{T}),N,A<:AbstractArray{T,N}}},img::AbstractImageDirect{Csrc<:Union(AbstractAlphaColorValue{C<:ColorValue{T},T<:Real},ColorValue{T}),N}) at /home/tim/.julia/v0.3/Images/src/core.jl:226
julia>convert(Image{RGB}, img)
ERROR:`convert` has no method matching convert(::Type{Image{RGB{T<:Union(FixedPoint,FloatingPoint)},N,A<:AbstractArray{T,N}}}, ::Image{RGB{UfixedBase{Uint8,8}},2,Array{RGB{UfixedBase{Uint8,8}},2}})
in convert at base.jl:13# OK, directly test that definition on Images/src/core.jl:226
julia>copy(img, Images._convert(Array{RGB}, data(img)))
RGB Image with:
data:768x512 Array{RGB{UfixedBase{Uint8,8}},2}
properties:
IMcs: sRGB
spatialorder: x y
pixelspacing:11# Can we replicate with some function besides convert?
julia>arg1{C<:Images.ColorTypes.ColorType}(::Type{Image{C}}) ="yes"
arg1 (generic function with 1 method)
julia>arg2{C<:Images.ColorTypes.ColorType}(::AbstractImageDirect{C}) ="yes"
arg2 (generic function with 1 method)
julia>arg12{C<:Images.ColorTypes.ColorType, D<:Images.ColorTypes.ColorType}(::Type{Image{C}}, ::AbstractImageDirect{D}) ="yes"
arg12 (generic function with 1 method)
julia>arg1(Image{RGB})
"yes"
julia>arg2(img)
"yes"
julia>arg12(Image{RGB}, img)
"yes"
The text was updated successfully, but these errors were encountered:
Here's a situation in which
@which
reports an available method, but actually trying to use the method results in aMethodError
. I'm probably doing something wrong, but for the life of me I can't figure out what. This happens on both master and 0.3.The text was updated successfully, but these errors were encountered: