@@ -155,26 +155,26 @@ See also: [`im_from_matlab`](@ref).
155
155
function im_to_matlab end
156
156
157
157
im_to_matlab (X:: AbstractArray{<:Number} ) = X
158
- im_to_matlab (img:: AbstractArray{CT} ) where CT<: Colorant = im_to_matlab (eltype (CT), img)
158
+ im_to_matlab (img:: AbstractArray{CT} ) where { CT<: Colorant } = im_to_matlab (eltype (CT), img)
159
159
160
160
im_to_matlab (:: Type{T} , img:: AbstractArray{CT} ) where {T,CT<: TransparentColor } =
161
161
im_to_matlab (T, of_eltype (base_color_type (CT), img))
162
- im_to_matlab (:: Type{T} , img:: AbstractArray{<:Color} ) where T =
162
+ im_to_matlab (:: Type{T} , img:: AbstractArray{<:Color} ) where {T} =
163
163
im_to_matlab (T, of_eltype (RGB{T}, img))
164
- im_to_matlab (:: Type{T} , img:: AbstractArray{<:Gray} ) where T =
164
+ im_to_matlab (:: Type{T} , img:: AbstractArray{<:Gray} ) where {T} =
165
165
of_eltype (T, channelview (img))
166
166
167
167
# for RGB, only 1d and 2d cases are supported as other cases are not well-defined in MATLAB.
168
- im_to_matlab (:: Type{T} , img:: AbstractVector{<:RGB} ) where T =
168
+ im_to_matlab (:: Type{T} , img:: AbstractVector{<:RGB} ) where {T} =
169
169
im_to_matlab (T, reshape (img, (length (img), 1 )))
170
- im_to_matlab (:: Type{T} , img:: AbstractMatrix{<:RGB} ) where T =
170
+ im_to_matlab (:: Type{T} , img:: AbstractMatrix{<:RGB} ) where {T} =
171
171
PermutedDimsArray (of_eltype (T, channelview (img)), (2 , 3 , 1 ))
172
- im_to_matlab (:: Type{T} , img:: AbstractArray{<:RGB} ) where T =
172
+ im_to_matlab (:: Type{T} , img:: AbstractArray{<:RGB} ) where {T} =
173
173
throw (ArgumentError (" For $(ndims (img)) dimensional color image, manual conversion to MATLAB layout is required." ))
174
174
175
175
if VERSION >= v " 1.6.0-DEV.1083"
176
176
# this method allows `data === im_to_matlab(im_from_matlab(data))` for gray image
177
- im_to_matlab (:: Type{T} , img:: Base.ReinterpretArray{CT,N,T,<:AbstractArray{T,N}, true} ) where {CT,N,T} =
177
+ im_to_matlab (:: Type{T} , img:: Base.ReinterpretArray{CT,N,T,<:AbstractArray{T,N},true} ) where {CT,N,T} =
178
178
img. parent
179
179
else
180
180
im_to_matlab (:: Type{T} , img:: Base.ReinterpretArray{CT,N,T,<:AbstractArray{T,N}} ) where {CT,N,T} =
0 commit comments