Class: PhotoUtils::Tools::CalcAperture

Inherits:
PhotoUtils::Tool show all
Defined in:
lib/photo_utils/tools/calc_aperture.rb

Instance Method Summary collapse

Methods inherited from PhotoUtils::Tool

#description, #initialize, #name, #usage

Constructor Details

This class inherits a constructor from PhotoUtils::Tool

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/photo_utils/tools/calc_aperture.rb', line 9

def run

  # set up basic scene

  basic_scene = Scene.new
  basic_scene.camera = Camera[/hasselblad/i]
  basic_scene.subject_distance = 12.feet
  basic_scene.background_distance = 14.feet
  basic_scene.camera.lens.aperture = 8
  basic_scene.description = basic_scene.camera.name

  puts "--- @ #{basic_scene.subject_distance.to_s(:imperial)}"
  basic_scene.camera.lenses.each do |lens|
    scene = basic_scene.dup
    scene.camera.shutter = nil
    scene.camera.lens = lens
    # scene.aperture = scene.aperture_for_depth_of_field(scene.subject_distance - 9.inches, scene.subject_distance + 9.inches)
    # next unless scene.aperture >= lens.max_aperture && scene.aperture <= lens.min_aperture
    # background_fov = scene.field_of_view(scene.background_distance)
    # next unless background_fov.width <= 4.feet && background_fov.height <= 4.feet
    # subject_fov = scene.field_of_view(scene.subject_distance)
    # next unless subject_fov.width >= 2.feet && subject_fov.height >= 2.feet
    # next unless scene.time < 1.0/15
    scene.description += ": #{scene.camera.lens.focal_length} @ #{scene.camera.lens.aperture}"
    puts "#{scene.description}:"
    scene.print_depth_of_field
    scene.print_exposure
    puts
  end

end