@@ -107,24 +107,25 @@ Supported encoding:
107
107
- ascii (`XTermColors` backend)
108
108
"""
109
109
110
- function imshow (io:: IO , img:: AbstractArray{<:Colorant} , maxsize:: Tuple = displaysize (io))
110
+ function imshow (
111
+ io:: IO , img:: AbstractArray{<:Colorant} , maxsize:: Tuple = displaysize (io); kw...
112
+ )
111
113
buf = IOContext (PipeBuffer (), :color => get (io, :color , false ))
112
114
if choose_sixel (img)
113
115
sixel_encode (buf, img)
114
116
else
117
+ print_func = (io, x) -> ascii_show (io, x, COLORMODE[], :auto , maxsize; kw... )
115
118
if ndims (img) > 2
116
- Base. show_nd (
117
- buf, img, (buf, x) -> ascii_show (buf, x, COLORMODE[], :auto , maxsize), true
118
- )
119
+ Base. show_nd (buf, img, print_func, true )
119
120
else
120
- ascii_show (buf, img, COLORMODE[], :auto , maxsize )
121
+ print_func (buf, img)
121
122
end
122
123
end
123
124
write (io, read (buf, String))
124
125
end
125
126
126
- imshow (img:: AbstractArray{<:Colorant} , args... ) = imshow (stdout , img, args... )
127
- imshow (img, args... ) =
127
+ imshow (img:: AbstractArray{<:Colorant} , args... ; kw ... ) = imshow (stdout , img, args... ; kw ... )
128
+ imshow (img, args... ; kw ... ) =
128
129
throw (ArgumentError (" imshow only supports colorant arrays with 1 or 2 dimensions" ))
129
130
130
131
sixel_encode (args... ; kwargs... ) = Sixel. sixel_encode (args... ; kwargs... )
0 commit comments