copy and clamp for greyscale images if outside (0,1)
This commit is contained in:
parent
f12d328cf7
commit
5e25989366
@ -323,12 +323,14 @@ end
|
|||||||
|
|
||||||
|
|
||||||
# # images - grays
|
# # images - grays
|
||||||
|
clamp_greys(mat::AMat{T}) where T<:Gray = Gray.(clamp!([m.val for m in mat], 0, 1))
|
||||||
|
|
||||||
@recipe function f(mat::AMat{T}) where T<:Gray
|
@recipe function f(mat::AMat{T}) where T<:Gray
|
||||||
n, m = size(mat)
|
n, m = size(mat)
|
||||||
if is_seriestype_supported(:image)
|
if is_seriestype_supported(:image)
|
||||||
seriestype := :image
|
seriestype := :image
|
||||||
yflip --> true
|
yflip --> true
|
||||||
|
any(x-> x.val<0 || x.val >1, mat) && (mat = clamp_greys(mat))
|
||||||
SliceIt, 1:m, 1:n, Surface(mat)
|
SliceIt, 1:m, 1:n, Surface(mat)
|
||||||
else
|
else
|
||||||
seriestype := :heatmap
|
seriestype := :heatmap
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user