-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoff-camera-light.st
More file actions
130 lines (120 loc) · 4.2 KB
/
off-camera-light.st
File metadata and controls
130 lines (120 loc) · 4.2 KB
1
2
3
4
5
6
7
8
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
"off-camera-light.st"
"Estimates the setting for using a camera and speed light or conversely estimates the necessary scene parameters based on camera and speed light settings"
Namespace current: OffCameraLight [
"The values and descriptions are from http://www.crakephoto.com/reference/index.html"
<comment: 'A dictionary associating light values with scene descriptions'>
LightValue := Dictionary new.
LightValue at: 17 put: 'Rarely seen in nature'.
LightValue at: 16 put: 'Bright sunlight off of sand or snow'.
LightValue at: 15 put: 'Bright hazy sunlight'.
LightValue at: 14 put: 'Weak hazy sunlight'.
LightValue at: 13 put: 'Bright cloudy day'.
LightValue at: 12 put: 'Overcast day'.
LightValue at: 11 put: 'Shade on a bright day or during sunrise/set'.
LightValue at: 10 put: 'Dusk or dawn'.
LightValue at: 9 put: 'Late dusk or early dawn'.
LightValue at: 8 put: 'Times square at night '.
LightValue at: 7 put: 'Brightly lit street '.
LightValue at: 6 put: 'Bright interior '.
LightValue at: 5 put: 'Average interior or auditorium'.
LightValue at: 4 put: 'Christmas or candle lights'.
LightValue at: 3 put: 'Fireworks (emitted)'.
LightValue at: 2 put: 'Lightning from a distance (emitted)'.
LightValue at: 1 put: 'City skyline at night (emitted)'.
LightValue at: 0 put: 'Dim ambient light'.
LightValue at: -1 put: 'Really dim ambient light'.
LightValue at: -2 put: 'Full moon off of sand or snow'.
LightValue at: -3 put: 'Full moon'.
LightValue at: -4 put: 'Half moon'.
LightValue at: -5 put: 'Crescent moon'.
LightValue at: -6 put: 'Starlight'.
Object subclass: Camera [
"The basis for variable names is Manual of Photography 10th edition.
n is relative aperture
t is shutter speed
s is sensitivity based"
| n t s |
<comment: 'A class for describing the state of a camera.'>
Camera class >> aperture: stop shutter: time iso: sensitivity [
^(self new)
aperture: stop;
shutter: time;
iso: sensitivity;
yourself.
]
aperture [
"Get the aperture value."
^n.
]
aperture: stop [
"Set the camera's aperture."
n := stop.
]
shutter [
"Get camera's shutter speed."
^t.
]
shutter: time [
"Set camera's shutter speed."
t := time.
]
iso [
"Get camera's sensitivity setting."
^s.
]
iso: sensitivity [
"Set camera's sensitivity setting."
s := sensitivity.
]
eV [
| sunny16Ev aperture shutter iso rawEv |
"Calculate the Exposure Value."
sunny16Ev := 8.
aperture := n squared log: 2.
shutter := 100 / (1/t) log: 2.
iso := (s / 100) log: 2.
rawEv := aperture + shutter + iso.
^'Not yet implemented'.
]
sunny16 [
"Calculate the number of stops away from Sunny 16 settings."
^eV - 15.
]
]
Object subclass: Light [
"A class to model a speedlight state."
| rating power_setting |
guide_number [
"Get the rating of a speedlight."
^rating.
]
guide_number: aDistance [
"Set the rating of a speedlight."
rating := aDistance.
]
power [
"Get the power setting of the speedlight."
^power_setting.
]
power: aNumber [
"Get the power setting of the speedlight."
power_setting := aNumber.
]
]
Object subclass: Subject [
| d |
"A class to describe a photographic subject."
distance [
"Get the distance to a subject."
^d.
]
distance: aNumber [
"Set the distance to a subject."
d := aNumber.
]
]
Object subclass: Scene [
| subject lV foreground background |
"A container for all the components of a photograph (sort of)."
]
]