Class: Halation::Roll::Frame

Inherits:
Object
  • Object
show all
Defined in:
lib/halation/roll/frame.rb

Overview

A frame on the roll of film.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml) ⇒ Frame

Returns a new instance of Frame



34
35
36
37
38
39
40
41
42
43
# File 'lib/halation/roll/frame.rb', line 34

def initialize(yaml)
  @number = Coerce.integer(yaml["number"])
  @date = Coerce.string(yaml["date"])
  @lens = Coerce.string(yaml["lens"])
  @focal_length = Coerce.integer(yaml["focal_length"])
  @shutter = Coerce.string(yaml["shutter"])
  @aperture = Coerce.string(yaml["aperture"])
  @flash = Coerce.boolean(yaml["flash"])
  @orientation = Coerce.integer(yaml["orientation"])
end

Instance Attribute Details

#apertureObject (readonly)

F-number of the aperture setting.



21
22
23
# File 'lib/halation/roll/frame.rb', line 21

def aperture
  @aperture
end

#dateObject (readonly)

Date the frame was taken.



10
11
12
# File 'lib/halation/roll/frame.rb', line 10

def date
  @date
end

#flashObject (readonly)

True if flash was fired.



23
24
25
# File 'lib/halation/roll/frame.rb', line 23

def flash
  @flash
end

#focal_lengthObject (readonly)

Focal length of the lens, if not specified by the lens profile (a zoom lens).



15
16
17
# File 'lib/halation/roll/frame.rb', line 15

def focal_length
  @focal_length
end

#lensObject (readonly)

Tag of the lens used.



12
13
14
# File 'lib/halation/roll/frame.rb', line 12

def lens
  @lens
end

#numberObject (readonly)

Frame number.



8
9
10
# File 'lib/halation/roll/frame.rb', line 8

def number
  @number
end

#orientationObject (readonly)

1 = Horizontal (normal) 2 = Mirror horizontal 3 = Rotate 180 4 = Mirror vertical 5 = Mirror horizontal and rotate 270 CW 6 = Rotate 90 CW 7 = Mirror horizontal and rotate 90 CW 8 = Rotate 270 CW



32
33
34
# File 'lib/halation/roll/frame.rb', line 32

def orientation
  @orientation
end

#shutterObject (readonly)

TODO:

spec

Shutter speed.

Examples:

“1/125”, “0.5” (half second), “15” (seconds), “120” (2 minutes)



19
20
21
# File 'lib/halation/roll/frame.rb', line 19

def shutter
  @shutter
end