source: gs2-extensions/parallel-building/trunk/src/perllib/cpan/Image/ExifTool/Sigma.pm@ 24626

Last change on this file since 24626 was 24626, checked in by jmt12, 13 years ago

An (almost) complete copy of the perllib directory from a (circa SEP2011) head checkout from Greenstone 2 trunk - in order to try and make merging in this extension a little easier later on (as there have been some major changes to buildcol.pl commited in the main trunk but not in the x64 branch)

File size: 9.3 KB
Line 
1#------------------------------------------------------------------------------
2# File: Sigma.pm
3#
4# Description: Sigma/Foveon EXIF maker notes tags
5#
6# Revisions: 04/06/2004 - P. Harvey Created
7# 02/20/2007 - PH added SD14 tags
8# 24/06/2010 - PH decode some SD15 tags
9#
10# Reference: http://www.x3f.info/technotes/FileDocs/MakerNoteDoc.html
11#------------------------------------------------------------------------------
12
13package Image::ExifTool::Sigma;
14
15use strict;
16use vars qw($VERSION);
17use Image::ExifTool::Exif;
18
19$VERSION = '1.09';
20
21%Image::ExifTool::Sigma::Main = (
22 WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
23 CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
24 WRITABLE => 'string',
25 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
26 0x0002 => 'SerialNumber',
27 0x0003 => 'DriveMode',
28 0x0004 => 'ResolutionMode',
29 0x0005 => 'AFMode',
30 0x0006 => 'FocusSetting',
31 0x0007 => 'WhiteBalance',
32 0x0008 => {
33 Name => 'ExposureMode',
34 PrintConv => { #PH
35 A => 'Aperture-priority AE',
36 M => 'Manual',
37 P => 'Program AE',
38 S => 'Shutter speed priority AE',
39 },
40 },
41 0x0009 => {
42 Name => 'MeteringMode',
43 PrintConv => { #PH
44 A => 'Average',
45 C => 'Center-weighted average',
46 8 => 'Multi-segment',
47 },
48 },
49 0x000a => 'LensFocalRange',
50 0x000b => 'ColorSpace',
51 # SIGMA PhotoPro writes these tags as strings, but some cameras (at least) write them as rational
52 0x000c => [
53 {
54 Name => 'ExposureCompensation',
55 Condition => '$format eq "string"',
56 ValueConv => '$val =~ s/Expo:\s*//, $val',
57 ValueConvInv => 'IsFloat($val) ? sprintf("Expo:%+.1f",$val) : undef',
58 },
59 { #PH
60 Name => 'ExposureAdjust',
61 Writable => 'rational64s',
62 Unknown => 1,
63 },
64 ],
65 0x000d => [
66 {
67 Name => 'Contrast',
68 Condition => '$format eq "string"',
69 ValueConv => '$val =~ s/Cont:\s*//, $val',
70 ValueConvInv => 'IsFloat($val) ? sprintf("Cont:%+.1f",$val) : undef',
71 },
72 { #PH
73 Name => 'Contrast',
74 Writable => 'rational64s',
75 },
76 ],
77 0x000e => [
78 {
79 Name => 'Shadow',
80 Condition => '$format eq "string"',
81 ValueConv => '$val =~ s/Shad:\s*//, $val',
82 ValueConvInv => 'IsFloat($val) ? sprintf("Shad:%+.1f",$val) : undef',
83 },
84 { #PH
85 Name => 'Shadow',
86 Writable => 'rational64s',
87 },
88 ],
89 0x000f => [
90 {
91 Name => 'Highlight',
92 Condition => '$format eq "string"',
93 ValueConv => '$val =~ s/High:\s*//, $val',
94 ValueConvInv => 'IsFloat($val) ? sprintf("High:%+.1f",$val) : undef',
95 },
96 { #PH
97 Name => 'Highlight',
98 Writable => 'rational64s',
99 },
100 ],
101 0x0010 => [
102 {
103 Name => 'Saturation',
104 Condition => '$format eq "string"',
105 ValueConv => '$val =~ s/Satu:\s*//, $val',
106 ValueConvInv => 'IsFloat($val) ? sprintf("Satu:%+.1f",$val) : undef',
107 },
108 { #PH
109 Name => 'Saturation',
110 Writable => 'rational64s',
111 },
112 ],
113 0x0011 => [
114 {
115 Name => 'Sharpness',
116 Condition => '$format eq "string"',
117 ValueConv => '$val =~ s/Shar:\s*//, $val',
118 ValueConvInv => 'IsFloat($val) ? sprintf("Shar:%+.1f",$val) : undef',
119 },
120 { #PH
121 Name => 'Sharpness',
122 Writable => 'rational64s',
123 },
124 ],
125 0x0012 => [
126 {
127 Name => 'X3FillLight',
128 Condition => '$format eq "string"',
129 ValueConv => '$val =~ s/Fill:\s*//, $val',
130 ValueConvInv => 'IsFloat($val) ? sprintf("Fill:%+.1f",$val) : undef',
131 },
132 { #PH
133 Name => 'X3FillLight',
134 Writable => 'rational64s',
135 },
136 ],
137 0x0014 => [
138 {
139 Name => 'ColorAdjustment',
140 Condition => '$format eq "string"',
141 ValueConv => '$val =~ s/CC:\s*//, $val',
142 ValueConvInv => 'IsInt($val) ? "CC:$val" : undef',
143 },
144 { #PH
145 Name => 'ColorAdjustment',
146 Writable => 'rational64s',
147 Count => 3,
148 },
149 ],
150 0x0015 => 'AdjustmentMode',
151 0x0016 => {
152 Name => 'Quality',
153 ValueConv => '$val =~ s/Qual:\s*//, $val',
154 ValueConvInv => 'IsInt($val) ? "Qual:$val" : undef',
155 },
156 0x0017 => 'Firmware',
157 0x0018 => 'Software',
158 0x0019 => 'AutoBracket',
159 0x001a => [ #PH
160 {
161 Name => 'PreviewImageStart',
162 Condition => '$format eq "int32u"',
163 IsOffset => 1,
164 OffsetPair => 0x001b,
165 DataTag => 'PreviewImage',
166 Writable => 'int32u',
167 Protected => 2,
168 },{ # (written by Sigma Photo Pro)
169 Name => 'ChrominanceNoiseReduction',
170 ValueConv => '$val =~ s/Chro:\s*//, $val',
171 ValueConvInv => 'IsFloat($val) ? sprintf("Chro:%+.1f",$val) : undef',
172 },
173 ],
174 0x001b => [ #PH
175 {
176 Name => 'PreviewImageLength',
177 Condition => '$format eq "int32u"',
178 OffsetPair => 0x001a,
179 DataTag => 'PreviewImage',
180 Writable => 'int32u',
181 Protected => 2,
182 },{ # (written by Sigma Photo Pro)
183 Name => 'LuminanceNoiseReduction',
184 ValueConv => '$val =~ s/Luma:\s*//, $val',
185 ValueConvInv => 'IsFloat($val) ? sprintf("Luma:%+.1f",$val) : undef',
186 },
187 ],
188 0x001c => { #PH
189 Name => 'PreviewImageSize',
190 Writable => 'int16u',
191 Count => 2,
192 },
193 0x001d => { #PH
194 Name => 'MakerNoteVersion',
195 Writable => 'undef',
196 },
197 # 0x001e - int16u: 0, 4, 13 - flash mode?
198 0x001f => { #PH (NC)
199 Name => 'AFPoint',
200 # values: "", "Center", "Center,Center", "Right,Right"
201 },
202 # 0x0020-21 - string: " "
203 0x0022 => { #PH (NC)
204 Name => 'FileFormat',
205 # values: "JPG", "JPG-S" or "X3F"
206 },
207 # 0x0023 - string: "", 10, 83, 131, 145, 150, 152, 169
208 0x0024 => 'Calibration',
209 # 0x0025 - string: "", "0.70", "0.90"
210 # 0x0026-2b - int32u: 0
211 0x002c => { #PH
212 Name => 'ColorMode',
213 Writable => 'int32u',
214 PrintConv => {
215 0 => 'n/a',
216 1 => 'Sepia',
217 2 => 'B&W',
218 3 => 'Standard',
219 4 => 'Vivid',
220 5 => 'Neutral',
221 6 => 'Portrait',
222 7 => 'Landscape',
223 },
224 },
225 # 0x002d - int32u: 0
226 # 0x002e - rational64s: (the negative of FlashExposureComp, but why?)
227 # 0x002f - int32u: 0, 1
228 0x0030 => { #PH
229 Name => 'LensApertureRange',
230 Notes => 'changes with focal length. MaxAperture for some models',
231 },
232 0x0031 => { #PH
233 Name => 'FNumber',
234 Writable => 'rational64u',
235 PrintConv => 'sprintf("%.1f",$val)',
236 PrintConvInv => '$val',
237 },
238 0x0032 => { #PH
239 Name => 'ExposureTime',
240 Writable => 'rational64u',
241 PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
242 PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
243 },
244 0x0033 => { #PH
245 Name => 'ExposureTime2',
246 Writable => 'string',
247 ValueConv => '$val * 1e-6',
248 ValueConvInv => 'int($val * 1e6 + 0.5)',
249 PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
250 PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
251 },
252 0x0034 => { #PH
253 Name => 'BurstShot',
254 Writable => 'int32u',
255 },
256 # 0x0034 - int32u: 0,1,2,3 or 4
257 0x0035 => { #PH
258 Name => 'ExposureCompensation',
259 Writable => 'rational64s',
260 # add a '+' sign to positive values
261 PrintConv => '$val and $val =~ s/^(\d)/\+$1/; $val',
262 PrintConvInv => '$val',
263 },
264 # 0x0036 - string: " "
265 # 0x0037-38 - string: ""
266 0x0039 => { #PH
267 Name => 'SensorTemperature',
268 # (string format)
269 PrintConv => 'IsInt($val) ? "$val C" : $val',
270 PrintConvInv => '$val=~s/ ?C$//; $val',
271 },
272 0x003a => { #PH
273 Name => 'FlashExposureComp',
274 Writable => 'rational64s',
275 },
276 0x003b => { #PH (how is this different from other Firmware?)
277 Name => 'Firmware',
278 Priority => 0,
279 },
280 0x003c => 'WhiteBalance', #PH
281 0x003d => { #PH (new for SD15)
282 Name => 'PictureMode',
283 Notes => 'same as ColorMode, but "Standard" when ColorMode is Sepia or B&W',
284 },
285);
286
2871; # end
288
289__END__
290
291=head1 NAME
292
293Image::ExifTool::Sigma - Sigma/Foveon EXIF maker notes tags
294
295=head1 SYNOPSIS
296
297This module is loaded automatically by Image::ExifTool when required.
298
299=head1 DESCRIPTION
300
301This module contains definitions required by Image::ExifTool to interpret
302Sigma and Foveon maker notes in EXIF information.
303
304=head1 AUTHOR
305
306Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
307
308This library is free software; you can redistribute it and/or modify it
309under the same terms as Perl itself.
310
311=head1 REFERENCES
312
313=over 4
314
315=item L<http://www.x3f.info/technotes/FileDocs/MakerNoteDoc.html>
316
317=back
318
319=head1 SEE ALSO
320
321L<Image::ExifTool::TagNames/Sigma Tags>,
322L<Image::ExifTool(3pm)|Image::ExifTool>
323
324=cut
Note: See TracBrowser for help on using the repository browser.