Method: PhotoUtils::SceneView#initialize
- Defined in:
- lib/photo_utils/scene_view.rb
#initialize(scene, options = {}) ⇒ SceneView
Returns a new instance of SceneView.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/photo_utils/scene_view.rb', line 15 def initialize(scene, ={}) @scene = scene @width = [:width] || 900 @height = [:height] || 50 @max_distance = [:max_distance] || @scene.depth_of_field.far @camera_width = [:camera_width] || @scene.focal_length @camera_height = [:camera_height] || [@scene.absolute_aperture, @scene.format.height].max @scale = (@width.to_f - @height) / (@camera_width + @max_distance) @camera_scale = [ @height.to_f / @camera_width, @height.to_f / @camera_height ].min end |