1 | /*
|
---|
2 | * This is public domain software - that is, you can do whatever you want
|
---|
3 | * with it, and include it software that is licensed under the GNU or the
|
---|
4 | * BSD license, or whatever other licence you choose, including proprietary
|
---|
5 | * closed source licenses. I do ask that you leave this header in tact.
|
---|
6 | *
|
---|
7 | * If you make modifications to this code that you think would benefit the
|
---|
8 | * wider community, please send me a copy and I'll post it on my site.
|
---|
9 | *
|
---|
10 | * If you make use of this code, I'd appreciate hearing about it.
|
---|
11 | * drew@drewnoakes.com
|
---|
12 | * Latest version of this software kept at
|
---|
13 | * http://drewnoakes.com/
|
---|
14 | *
|
---|
15 | * Created by dnoakes on 27-Nov-2002 10:12:05 using IntelliJ IDEA.
|
---|
16 | */
|
---|
17 | package com.drew.metadata.exif;
|
---|
18 |
|
---|
19 | import com.drew.metadata.Directory;
|
---|
20 | import com.drew.metadata.MetadataException;
|
---|
21 | import com.drew.metadata.TagDescriptor;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | *
|
---|
25 | */
|
---|
26 | public class CasioType1MakernoteDescriptor extends TagDescriptor
|
---|
27 | {
|
---|
28 | public CasioType1MakernoteDescriptor(Directory directory)
|
---|
29 | {
|
---|
30 | super(directory);
|
---|
31 | }
|
---|
32 |
|
---|
33 | public String getDescription(int tagType) throws MetadataException
|
---|
34 | {
|
---|
35 | switch (tagType) {
|
---|
36 | case CasioType1MakernoteDirectory.TAG_CASIO_RECORDING_MODE:
|
---|
37 | return getRecordingModeDescription();
|
---|
38 | case CasioType1MakernoteDirectory.TAG_CASIO_QUALITY:
|
---|
39 | return getQualityDescription();
|
---|
40 | case CasioType1MakernoteDirectory.TAG_CASIO_FOCUSING_MODE:
|
---|
41 | return getFocusingModeDescription();
|
---|
42 | case CasioType1MakernoteDirectory.TAG_CASIO_FLASH_MODE:
|
---|
43 | return getFlashModeDescription();
|
---|
44 | case CasioType1MakernoteDirectory.TAG_CASIO_FLASH_INTENSITY:
|
---|
45 | return getFlashIntensityDescription();
|
---|
46 | case CasioType1MakernoteDirectory.TAG_CASIO_OBJECT_DISTANCE:
|
---|
47 | return getObjectDistanceDescription();
|
---|
48 | case CasioType1MakernoteDirectory.TAG_CASIO_WHITE_BALANCE:
|
---|
49 | return getWhiteBalanceDescription();
|
---|
50 | case CasioType1MakernoteDirectory.TAG_CASIO_DIGITAL_ZOOM:
|
---|
51 | return getDigitalZoomDescription();
|
---|
52 | case CasioType1MakernoteDirectory.TAG_CASIO_SHARPNESS:
|
---|
53 | return getSharpnessDescription();
|
---|
54 | case CasioType1MakernoteDirectory.TAG_CASIO_CONTRAST:
|
---|
55 | return getContrastDescription();
|
---|
56 | case CasioType1MakernoteDirectory.TAG_CASIO_SATURATION:
|
---|
57 | return getSaturationDescription();
|
---|
58 | case CasioType1MakernoteDirectory.TAG_CASIO_CCD_SENSITIVITY:
|
---|
59 | return getCcdSensitivityDescription();
|
---|
60 | default:
|
---|
61 | return _directory.getString(tagType);
|
---|
62 | }
|
---|
63 | }
|
---|
64 |
|
---|
65 | public String getCcdSensitivityDescription() throws MetadataException
|
---|
66 | {
|
---|
67 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_CCD_SENSITIVITY)) return null;
|
---|
68 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_CCD_SENSITIVITY);
|
---|
69 | switch (value) {
|
---|
70 | // these four for QV3000
|
---|
71 | case 64:
|
---|
72 | return "Normal";
|
---|
73 | case 125:
|
---|
74 | return "+1.0";
|
---|
75 | case 250:
|
---|
76 | return "+2.0";
|
---|
77 | case 244:
|
---|
78 | return "+3.0";
|
---|
79 | // these two for QV8000/2000
|
---|
80 | case 80:
|
---|
81 | return "Normal (ISO 80 equivalent)";
|
---|
82 | case 100:
|
---|
83 | return "High";
|
---|
84 | default:
|
---|
85 | return "Unknown (" + value + ")";
|
---|
86 | }
|
---|
87 | }
|
---|
88 |
|
---|
89 | public String getSaturationDescription() throws MetadataException
|
---|
90 | {
|
---|
91 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_SATURATION)) return null;
|
---|
92 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_SATURATION);
|
---|
93 | switch (value) {
|
---|
94 | case 0:
|
---|
95 | return "Normal";
|
---|
96 | case 1:
|
---|
97 | return "Low";
|
---|
98 | case 2:
|
---|
99 | return "High";
|
---|
100 | default:
|
---|
101 | return "Unknown (" + value + ")";
|
---|
102 | }
|
---|
103 | }
|
---|
104 |
|
---|
105 | public String getContrastDescription() throws MetadataException
|
---|
106 | {
|
---|
107 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_CONTRAST)) return null;
|
---|
108 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_CONTRAST);
|
---|
109 | switch (value) {
|
---|
110 | case 0:
|
---|
111 | return "Normal";
|
---|
112 | case 1:
|
---|
113 | return "Low";
|
---|
114 | case 2:
|
---|
115 | return "High";
|
---|
116 | default:
|
---|
117 | return "Unknown (" + value + ")";
|
---|
118 | }
|
---|
119 | }
|
---|
120 |
|
---|
121 | public String getSharpnessDescription() throws MetadataException
|
---|
122 | {
|
---|
123 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_SHARPNESS)) return null;
|
---|
124 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_SHARPNESS);
|
---|
125 | switch (value) {
|
---|
126 | case 0:
|
---|
127 | return "Normal";
|
---|
128 | case 1:
|
---|
129 | return "Soft";
|
---|
130 | case 2:
|
---|
131 | return "Hard";
|
---|
132 | default:
|
---|
133 | return "Unknown (" + value + ")";
|
---|
134 | }
|
---|
135 | }
|
---|
136 |
|
---|
137 | public String getDigitalZoomDescription() throws MetadataException
|
---|
138 | {
|
---|
139 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_DIGITAL_ZOOM)) return null;
|
---|
140 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_DIGITAL_ZOOM);
|
---|
141 | switch (value) {
|
---|
142 | case 0x10000:
|
---|
143 | return "No digital zoom";
|
---|
144 | case 0x10001:
|
---|
145 | return "2x digital zoom";
|
---|
146 | case 0x20000:
|
---|
147 | return "2x digital zoom";
|
---|
148 | case 0x40000:
|
---|
149 | return "4x digital zoom";
|
---|
150 | default:
|
---|
151 | return "Unknown (" + value + ")";
|
---|
152 | }
|
---|
153 | }
|
---|
154 |
|
---|
155 | public String getWhiteBalanceDescription() throws MetadataException
|
---|
156 | {
|
---|
157 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_WHITE_BALANCE)) return null;
|
---|
158 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_WHITE_BALANCE);
|
---|
159 | switch (value) {
|
---|
160 | case 1:
|
---|
161 | return "Auto";
|
---|
162 | case 2:
|
---|
163 | return "Tungsten";
|
---|
164 | case 3:
|
---|
165 | return "Daylight";
|
---|
166 | case 4:
|
---|
167 | return "Flourescent";
|
---|
168 | case 5:
|
---|
169 | return "Shade";
|
---|
170 | case 129:
|
---|
171 | return "Manual";
|
---|
172 | default:
|
---|
173 | return "Unknown (" + value + ")";
|
---|
174 | }
|
---|
175 | }
|
---|
176 |
|
---|
177 | public String getObjectDistanceDescription() throws MetadataException
|
---|
178 | {
|
---|
179 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_OBJECT_DISTANCE)) return null;
|
---|
180 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_OBJECT_DISTANCE);
|
---|
181 | return value + " mm";
|
---|
182 | }
|
---|
183 |
|
---|
184 | public String getFlashIntensityDescription() throws MetadataException
|
---|
185 | {
|
---|
186 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_FLASH_INTENSITY)) return null;
|
---|
187 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_FLASH_INTENSITY);
|
---|
188 | switch (value) {
|
---|
189 | case 11:
|
---|
190 | return "Weak";
|
---|
191 | case 13:
|
---|
192 | return "Normal";
|
---|
193 | case 15:
|
---|
194 | return "Strong";
|
---|
195 | default:
|
---|
196 | return "Unknown (" + value + ")";
|
---|
197 | }
|
---|
198 | }
|
---|
199 |
|
---|
200 | public String getFlashModeDescription() throws MetadataException
|
---|
201 | {
|
---|
202 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_FLASH_MODE)) return null;
|
---|
203 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_FLASH_MODE);
|
---|
204 | switch (value) {
|
---|
205 | case 1:
|
---|
206 | return "Auto";
|
---|
207 | case 2:
|
---|
208 | return "On";
|
---|
209 | case 3:
|
---|
210 | return "Off";
|
---|
211 | case 4:
|
---|
212 | // this documented as additional value for off here:
|
---|
213 | // http://www.ozhiker.com/electronics/pjmt/jpeg_info/casio_mn.html
|
---|
214 | return "Red eye reduction";
|
---|
215 | default:
|
---|
216 | return "Unknown (" + value + ")";
|
---|
217 | }
|
---|
218 | }
|
---|
219 |
|
---|
220 | public String getFocusingModeDescription() throws MetadataException
|
---|
221 | {
|
---|
222 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_FOCUSING_MODE)) return null;
|
---|
223 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_FOCUSING_MODE);
|
---|
224 | switch (value) {
|
---|
225 | case 2:
|
---|
226 | return "Macro";
|
---|
227 | case 3:
|
---|
228 | return "Auto focus";
|
---|
229 | case 4:
|
---|
230 | return "Manual focus";
|
---|
231 | case 5:
|
---|
232 | return "Infinity";
|
---|
233 | default:
|
---|
234 | return "Unknown (" + value + ")";
|
---|
235 | }
|
---|
236 | }
|
---|
237 |
|
---|
238 | public String getQualityDescription() throws MetadataException
|
---|
239 | {
|
---|
240 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_QUALITY)) return null;
|
---|
241 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_QUALITY);
|
---|
242 | switch (value) {
|
---|
243 | case 1:
|
---|
244 | return "Economy";
|
---|
245 | case 2:
|
---|
246 | return "Normal";
|
---|
247 | case 3:
|
---|
248 | return "Fine";
|
---|
249 | default:
|
---|
250 | return "Unknown (" + value + ")";
|
---|
251 | }
|
---|
252 | }
|
---|
253 |
|
---|
254 | public String getRecordingModeDescription() throws MetadataException
|
---|
255 | {
|
---|
256 | if (!_directory.containsTag(CasioType1MakernoteDirectory.TAG_CASIO_RECORDING_MODE)) return null;
|
---|
257 | int value = _directory.getInt(CasioType1MakernoteDirectory.TAG_CASIO_RECORDING_MODE);
|
---|
258 | switch (value) {
|
---|
259 | case 1:
|
---|
260 | return "Single shutter";
|
---|
261 | case 2:
|
---|
262 | return "Panorama";
|
---|
263 | case 3:
|
---|
264 | return "Night scene";
|
---|
265 | case 4:
|
---|
266 | return "Portrait";
|
---|
267 | case 5:
|
---|
268 | return "Landscape";
|
---|
269 | default:
|
---|
270 | return "Unknown (" + value + ")";
|
---|
271 | }
|
---|
272 | }
|
---|
273 | }
|
---|