Merge pull request #971 from timholy/pull-request/a7a447a8
Update to newer Images
This commit is contained in:
commit
65c3d90642
@ -66,9 +66,8 @@ function _initialize_backend(::GLVisualizeBackend; kw...)
|
|||||||
import GLVisualize: visualize
|
import GLVisualize: visualize
|
||||||
import Plots.GL
|
import Plots.GL
|
||||||
import UnicodeFun
|
import UnicodeFun
|
||||||
Plots.slice_arg(img::Images.AbstractImage, idx::Int) = img
|
Plots.slice_arg{C<:Colorant}(img::Matrix{C}, idx::Int) = img
|
||||||
is_marker_supported(::GLVisualizeBackend, shape::GLVisualize.AllPrimitives) = true
|
is_marker_supported(::GLVisualizeBackend, shape::GLVisualize.AllPrimitives) = true
|
||||||
is_marker_supported{Img<:Images.AbstractImage}(::GLVisualizeBackend, shape::Union{Vector{Img}, Img}) = true
|
|
||||||
is_marker_supported{C<:Colorant}(::GLVisualizeBackend, shape::Union{Vector{Matrix{C}}, Matrix{C}}) = true
|
is_marker_supported{C<:Colorant}(::GLVisualizeBackend, shape::Union{Vector{Matrix{C}}, Matrix{C}}) = true
|
||||||
is_marker_supported(::GLVisualizeBackend, shape::Shape) = true
|
is_marker_supported(::GLVisualizeBackend, shape::Shape) = true
|
||||||
const GL = Plots
|
const GL = Plots
|
||||||
@ -789,7 +788,7 @@ function gl_bar(d, kw_args)
|
|||||||
fillto = 0
|
fillto = 0
|
||||||
end
|
end
|
||||||
# create the bar shapes by adding x/y segments
|
# create the bar shapes by adding x/y segments
|
||||||
positions, scales = Array(Point2f0, ny), Array(Vec2f0, ny)
|
positions, scales = Array{Point2f0}(ny), Array{Vec2f0}(ny)
|
||||||
m = Reactive.value(kw_args[:model])
|
m = Reactive.value(kw_args[:model])
|
||||||
sx, sy = m[1,1], m[2,2]
|
sx, sy = m[1,1], m[2,2]
|
||||||
for i=1:ny
|
for i=1:ny
|
||||||
@ -940,7 +939,7 @@ function scale_for_annotations!(series::Series, scaletype::Symbol = :pixels)
|
|||||||
# we use baseshape to overwrite the markershape attribute
|
# we use baseshape to overwrite the markershape attribute
|
||||||
# with a list of custom shapes for each
|
# with a list of custom shapes for each
|
||||||
msw, msh = anns.scalefactor
|
msw, msh = anns.scalefactor
|
||||||
offsets = Array(Vec2f0, length(anns.strs))
|
offsets = Array{Vec2f0}(length(anns.strs))
|
||||||
series[:markersize] = map(1:length(anns.strs)) do i
|
series[:markersize] = map(1:length(anns.strs)) do i
|
||||||
str = _cycle(anns.strs, i)
|
str = _cycle(anns.strs, i)
|
||||||
# get the width and height of the string (in mm)
|
# get the width and height of the string (in mm)
|
||||||
@ -1145,10 +1144,7 @@ function _show(io::IO, ::MIME"image/png", plt::Plot{GLVisualizeBackend})
|
|||||||
GLWindow.render_frame(GLWindow.rootscreen(plt.o))
|
GLWindow.render_frame(GLWindow.rootscreen(plt.o))
|
||||||
GLWindow.swapbuffers(plt.o)
|
GLWindow.swapbuffers(plt.o)
|
||||||
buff = GLWindow.screenbuffer(plt.o)
|
buff = GLWindow.screenbuffer(plt.o)
|
||||||
png = Images.Image(map(RGB{U8}, buff),
|
png = map(RGB{U8}, buff)
|
||||||
colorspace = "sRGB",
|
|
||||||
spatialorder = ["y", "x"]
|
|
||||||
)
|
|
||||||
FileIO.save(FileIO.Stream(FileIO.DataFormat{:PNG}, io), png)
|
FileIO.save(FileIO.Stream(FileIO.DataFormat{:PNG}, io), png)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -66,8 +66,8 @@ PlotExample("Global",
|
|||||||
PlotExample("Images",
|
PlotExample("Images",
|
||||||
"Plot an image. y-axis is set to flipped",
|
"Plot an image. y-axis is set to flipped",
|
||||||
[:(begin
|
[:(begin
|
||||||
import Images
|
import FileIO
|
||||||
img = Images.load(Pkg.dir("PlotReferenceImages","Plots","pyplot","0.7.0","ref1.png"))
|
img = FileIO.load(Pkg.dir("PlotReferenceImages","Plots","pyplot","0.7.0","ref1.png"))
|
||||||
plot(img)
|
plot(img)
|
||||||
end)]
|
end)]
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user