if (FALSE) { # interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true")
#Plot the dragon
plot_image(dragon)
#Plot the depth map
plot_image(dragondepth/1500)
#Preview the focal plane:
render_bokeh(dragon, dragondepth, focus=950, preview_focus = TRUE)
#Change the focal length:
render_bokeh(dragon, dragondepth, focus=950, focallength=300)
#Add chromatic aberration:
render_bokeh(dragon, dragondepth, focus=950, focallength=300, aberration = 0.5)
#Change the focal distance:
render_bokeh(dragon, dragondepth, focus=600, focallength=300)
render_bokeh(dragon, dragondepth, focus=1300, focallength=300)
#Change the bokeh shape to a hexagon:
render_bokeh(dragon, dragondepth, bokehshape = "hex",
focallength=300, focus=600)
#Change the bokeh intensity:
render_bokeh(dragon, dragondepth,
focallength=400, focus=900, bokehintensity = 1)
render_bokeh(dragon, dragondepth,
focallength=400, focus=900, bokehintensity = 3)
#Rotate the hexagonal shape:
render_bokeh(dragon, dragondepth, bokehshape = "hex", rotation=15, bokehintensity=3,
focallength=400, focus=800)
}
Run the code above in your browser using DataLab