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.



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

def initialize(yaml)
  @number = Coerce.integer(yaml["number"])
  @date_captured = Coerce.date(yaml["date_captured"])
  @date_scanned = Coerce.date(yaml["date_scanned"])
  @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.



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

def aperture
  @aperture
end

#date_capturedObject (readonly)

Date the frame was captured, in ISO 8601 format.



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

def date_captured
  @date_captured
end

#date_scannedObject (readonly)

Date the frame was scanned (digitized), in ISO 8601 format.



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

def date_scanned
  @date_scanned
end

#flashObject (readonly)

True if flash was fired.



25
26
27
# File 'lib/halation/roll/frame.rb', line 25

def flash
  @flash
end

#focal_lengthObject (readonly)

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



17
18
19
# File 'lib/halation/roll/frame.rb', line 17

def focal_length
  @focal_length
end

#lensObject (readonly)

Tag of the lens used.



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

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



34
35
36
# File 'lib/halation/roll/frame.rb', line 34

def orientation
  @orientation
end

#shutterObject (readonly)

TODO:

spec

Shutter speed.

Examples:

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



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

def shutter
  @shutter
end