1 | #------------------------------------------------------------------------------
|
---|
2 | # File: Reconyx.pm
|
---|
3 | #
|
---|
4 | # Description: Reconyx maker notes tags
|
---|
5 | #
|
---|
6 | # Revisions: 2011-01-11 - P. Harvey Created
|
---|
7 | #
|
---|
8 | # References: 1) RCNX_MN10.pdf (courtesy of Reconyx Inc.)
|
---|
9 | #------------------------------------------------------------------------------
|
---|
10 |
|
---|
11 | package Image::ExifTool::Reconyx;
|
---|
12 |
|
---|
13 | use strict;
|
---|
14 | use vars qw($VERSION);
|
---|
15 |
|
---|
16 | $VERSION = '1.02';
|
---|
17 |
|
---|
18 | # maker notes for Reconyx Hyperfire cameras (ref PH)
|
---|
19 | %Image::ExifTool::Reconyx::Main = (
|
---|
20 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
21 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
22 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
23 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
24 | TAG_PREFIX => 'Reconyx',
|
---|
25 | FORMAT => 'int16u',
|
---|
26 | WRITABLE => 1,
|
---|
27 | FIRST_ENTRY => 0,
|
---|
28 | NOTES => q{
|
---|
29 | The following tags are extracted from the maker notes of Reconyx Hyperfire
|
---|
30 | cameras such as the HC500, HC600 and PC900.
|
---|
31 | },
|
---|
32 | 0x00 => { #1
|
---|
33 | Name => 'MakerNoteVersion',
|
---|
34 | PrintConv => 'sprintf("0x%.4x", $val)',
|
---|
35 | Writable => 0, # (we use this for identification, 0xf101 --> rev 1.0)
|
---|
36 | PrintConvInv => 'hex $val',
|
---|
37 | },
|
---|
38 | 0x01 => { #1
|
---|
39 | Name => 'FirmwareVersion',
|
---|
40 | Format => 'int16u[3]',
|
---|
41 | PrintConv => '$val=~tr/ /./; $val',
|
---|
42 | Writable => 0, # (we use this for identification, 0x0003 --> ver 2 or 3)
|
---|
43 | },
|
---|
44 | 0x04 => { #1
|
---|
45 | Name => 'FirmwareDate',
|
---|
46 | Format => 'int16u[2]',
|
---|
47 | ValueConv => q{
|
---|
48 | my @v = split(' ',$val);
|
---|
49 | sprintf('%.4x:%.2x:%.2x', $v[0], $v[1]>>8, $v[1]&0xff);
|
---|
50 | },
|
---|
51 | ValueConvInv => q{
|
---|
52 | my @v = split(':', $val);
|
---|
53 | hex($v[0]) . ' ' . hex($v[1] . $v[2]);
|
---|
54 | },
|
---|
55 | },
|
---|
56 | 0x06 => {
|
---|
57 | Name => 'TriggerMode',
|
---|
58 | Format => 'string[2]',
|
---|
59 | PrintConv => {
|
---|
60 | C => 'CodeLoc Not Entered', #1
|
---|
61 | E => 'External Sensor', #1
|
---|
62 | M => 'Motion Detection',
|
---|
63 | T => 'Time Lapse',
|
---|
64 | },
|
---|
65 | },
|
---|
66 | 0x07 => {
|
---|
67 | Name => 'Sequence',
|
---|
68 | Format => 'int16u[2]',
|
---|
69 | PrintConv => '$val =~ s/ / of /; $val',
|
---|
70 | PrintConvInv => 'join(" ", $val=~/\d+/g)',
|
---|
71 | },
|
---|
72 | 0x09 => { #1
|
---|
73 | Name => 'EventNumber',
|
---|
74 | Format => 'int16u[2]',
|
---|
75 | ValueConv => 'my @v=split(" ",$val); ($v[0]<<16) + $v[1]',
|
---|
76 | ValueConvInv => '($val>>16) . " " . ($val&0xffff)',
|
---|
77 | },
|
---|
78 | 0x0b => {
|
---|
79 | Name => 'DateTimeOriginal',
|
---|
80 | Description => 'Date/Time Original',
|
---|
81 | Format => 'int16u[6]',
|
---|
82 | Groups => { 2 => 'Time' },
|
---|
83 | Shift => 'Time',
|
---|
84 | ValueConv => q{
|
---|
85 | my @a = split ' ', $val;
|
---|
86 | sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d', @a[5,3,4,2,1,0]);
|
---|
87 | },
|
---|
88 | ValueConvInv => q{
|
---|
89 | my @a = ($val =~ /\d+/g);
|
---|
90 | return undef unless @a >= 6;
|
---|
91 | join ' ', @a[5,4,3,1,2,0];
|
---|
92 | },
|
---|
93 | PrintConv => '$self->ConvertDateTime($val)',
|
---|
94 | PrintConvInv => '$val',
|
---|
95 | },
|
---|
96 | 0x12 => {
|
---|
97 | Name => 'MoonPhase',
|
---|
98 | Groups => { 2 => 'Time' },
|
---|
99 | PrintConv => {
|
---|
100 | 0 => 'New',
|
---|
101 | 1 => 'New Crescent',
|
---|
102 | 2 => 'First Quarter',
|
---|
103 | 3 => 'Waxing Gibbous',
|
---|
104 | 4 => 'Full',
|
---|
105 | 5 => 'Waning Gibbous',
|
---|
106 | 6 => 'Last Quarter',
|
---|
107 | 7 => 'Old Crescent',
|
---|
108 | },
|
---|
109 | },
|
---|
110 | 0x13 => {
|
---|
111 | Name => 'AmbientTemperatureFahrenheit',
|
---|
112 | PrintConv => '"$val F"',
|
---|
113 | PrintConvInv => '$val=~/(\d+)/ ? $1 : $val',
|
---|
114 | },
|
---|
115 | 0x14 => {
|
---|
116 | Name => 'AmbientTemperature',
|
---|
117 | PrintConv => '"$val C"',
|
---|
118 | PrintConvInv => '$val=~/(\d+)/ ? $1 : $val',
|
---|
119 | },
|
---|
120 | 0x15 => {
|
---|
121 | Name => 'SerialNumber',
|
---|
122 | Format => 'undef[30]',
|
---|
123 | RawConv => '$_ = $self->Decode($val, "UCS2"); s/\0.*//; $_',
|
---|
124 | RawConvInv => q{
|
---|
125 | $_ = $self->Encode($val, "UCS2");
|
---|
126 | $_ = substr($_, 0, 30) if length($_) > 30;
|
---|
127 | return $_;
|
---|
128 | },
|
---|
129 | },
|
---|
130 | 0x24 => 'Contrast', #1
|
---|
131 | 0x25 => 'Brightness', #1
|
---|
132 | 0x26 => 'Sharpness', #1
|
---|
133 | 0x27 => 'Saturation', #1
|
---|
134 | 0x28 => {
|
---|
135 | Name => 'InfraredIlluminator',
|
---|
136 | PrintConv => {
|
---|
137 | 0 => 'Off',
|
---|
138 | 1 => 'On',
|
---|
139 | },
|
---|
140 | },
|
---|
141 | 0x29 => 'MotionSensitivity', #1
|
---|
142 | 0x2a => { #1
|
---|
143 | Name => 'BatteryVoltage',
|
---|
144 | ValueConv => '$val / 1000',
|
---|
145 | ValueConvInv => '$val * 1000',
|
---|
146 | PrintConv => '"$val V"',
|
---|
147 | PrintConvInv => '$val=~s/ ?V$//; $val',
|
---|
148 | },
|
---|
149 | 0x2b => {
|
---|
150 | Name => 'UserLabel',
|
---|
151 | Format => 'string[22]', #1 (but manual says 16-char limit)
|
---|
152 | },
|
---|
153 | );
|
---|
154 |
|
---|
155 |
|
---|
156 | __END__
|
---|
157 |
|
---|
158 | =head1 NAME
|
---|
159 |
|
---|
160 | Image::ExifTool::Reconyx - Reconyx maker notes tags
|
---|
161 |
|
---|
162 | =head1 SYNOPSIS
|
---|
163 |
|
---|
164 | This module is loaded automatically by Image::ExifTool when required.
|
---|
165 |
|
---|
166 | =head1 DESCRIPTION
|
---|
167 |
|
---|
168 | This module contains definitions required by Image::ExifTool to interpret
|
---|
169 | maker notes in Reconyx cameras.
|
---|
170 |
|
---|
171 | =head1 AUTHOR
|
---|
172 |
|
---|
173 | Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
|
---|
174 |
|
---|
175 | This library is free software; you can redistribute it and/or modify it
|
---|
176 | under the same terms as Perl itself.
|
---|
177 |
|
---|
178 | =head1 SEE ALSO
|
---|
179 |
|
---|
180 | L<Image::ExifTool::TagNames/Reconyx Tags>,
|
---|
181 | L<Image::ExifTool(3pm)|Image::ExifTool>
|
---|
182 |
|
---|
183 | =cut
|
---|