main.html
Main Page
|
classes.html
Alphabetical List
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
functions.html
Data Fields
|
globals.html
Globals
dir_000000.html
libexif
&raquo
dir_000001.html
canon
mnote-canon-entry.c
mnote-canon-entry_8c.html
Go to the documentation of this file.
00001
/* mnote-canon-entry.c
00002
*
00003
* Copyright ? 2002 Lutz M?ller <lutz@users.sourceforge.net>
00004
* Copyright ? 2003 Matthieu Castet <mat-c@users.sourceforge.net>
00005
*
00006
* This library is free software; you can redistribute it and/or
00007
* modify it under the terms of the GNU Lesser General Public
00008
* License as published by the Free Software Foundation; either
00009
* version 2 of the License, or (at your option) any later version.
00010
*
00011
* This library is distributed in the hope that it will be useful,
00012
* but WITHOUT ANY WARRANTY; without even the implied warranty of
00013
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014
* Lesser General Public License for more details.
00015
*
00016
* You should have received a copy of the GNU Lesser General Public
00017
* License along with this library; if not, write to the
00018
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019
* Boston, MA 02111-1307, USA.
00020
*/
00021
00022
#include "config.h"
00023
#include "
mnote-canon-entry_8h.html
mnote-canon-entry.h
"
00024
00025
#include <stdio.h>
00026
#include <stdlib.h>
00027
#include <string.h>
00028
00029
#include <
exif-format_8h.html
libexif/exif-format.h
>
00030
#include <
exif-utils_8h.html
libexif/exif-utils.h
>
00031
#include <
i18n_8h.html
libexif/i18n.h
>
00032
00033
/* #define DEBUG */
00034
mnote-canon-entry_8c.html#a0
00035
#define CF(format,target,v,maxlen)                              \
00036
{                                                               \
00037
if (format != target) {                                 \
00038
snprintf (v, maxlen,                            \
00039
_("Invalid format '%s', "               \
00040
"expected '%s'."),                      \
00041
exif_format_get_name (format),          \
00042
exif_format_get_name (target));         \
00043
break;                                          \
00044
}                                                       \
00045
}
00046
mnote-canon-entry_8c.html#a1
00047
#define CC(number,target,v,maxlen)                                      \
00048
{                                                                       \
00049
if (number != target) {                                         \
00050
snprintf (v, maxlen,                                    \
00051
_("Invalid number of components (%i, "          \
00052
"expected %i)."), (int) number, (int) target);  \
00053
break;                                                  \
00054
}                                                               \
00055
}
mnote-canon-entry_8c.html#a2
00056
#define CC2(number,t1,t2,v,maxlen)                                      \
00057
{                                                                       \
00058
if ((number != t1) && (number != t2)) {                         \
00059
snprintf (v, maxlen,                                    \
00060
_("Invalid number of components (%i, "          \
00061
"expected %i or %i)."), (int) number,           \
00062
(int) t1, (int) t2);                            \
00063
break;                                                  \
00064
}                                                               \
00065
}
00066
mnote-canon-entry_8c.html#a3
00067
#define UNDEFINED 0xFF
00068
00069
static
struct
{
mnote-canon-entry_8c.html#a4
00070
unsigned
int
mnote-canon-entry_8c.html#a4
subtag
;
mnote-canon-entry_8c.html#a5
00071
exif-utils_8h.html#a4
ExifShort
mnote-canon-entry_8c.html#a5
value
;
mnote-canon-entry_8c.html#a6
00072
char
*
mnote-canon-entry_8c.html#a6
name
;
00073 }
mnote-canon-entry_8c.html#a7
entries
[] = {
00074   { 0,  1,
i18n_8h.html#a7
N_
(
"macro"
)},
00075   { 0,  2,
i18n_8h.html#a7
N_
(
"normal"
)},
00076   { 3,  0,
i18n_8h.html#a7
N_
(
"flash did not fire"
)},
00077   { 3,  1,
i18n_8h.html#a7
N_
(
"auto"
)},
00078   { 3,  2,
i18n_8h.html#a7
N_
(
"on"
)},
00079   { 3,  3,
i18n_8h.html#a7
N_
(
"red eyes reduction"
)},
00080   { 3,  4,
i18n_8h.html#a7
N_
(
"slow synchro"
)},
00081   { 3,  5,
i18n_8h.html#a7
N_
(
"auto + red yes reduction"
)},
00082   { 3,  6,
i18n_8h.html#a7
N_
(
"on + red eyes reduction"
)},
00083   { 3, 16,
i18n_8h.html#a7
N_
(
"external"
)},
00084   { 4,  0,
i18n_8h.html#a7
N_
(
"single or timer"
)},
00085   { 4,  1,
i18n_8h.html#a7
N_
(
"continuous"
)},
00086   { 6,  0,
i18n_8h.html#a7
N_
(
"one-Shot"
)},
00087   { 6,  1,
i18n_8h.html#a7
N_
(
"AI Servo"
)},
00088   { 6,  2,
i18n_8h.html#a7
N_
(
"AI Focus"
)},
00089   { 6,  3,
i18n_8h.html#a7
N_
(
"MF"
)},
00090   { 6,  4,
i18n_8h.html#a7
N_
(
"Single"
)},
00091   { 6,  5,
i18n_8h.html#a7
N_
(
"Continuous"
)},
00092   { 6,  6,
i18n_8h.html#a7
N_
(
"MF"
)},
00093   { 9,  0,
i18n_8h.html#a7
N_
(
"large"
)},
00094   { 9,  1,
i18n_8h.html#a7
N_
(
"medium"
)},
00095   { 9,  2,
i18n_8h.html#a7
N_
(
"small"
)},
00096   {10,  0,
i18n_8h.html#a7
N_
(
"full auto"
)},
00097         {10,  1,
i18n_8h.html#a7
N_
(
"manual"
)},
00098         {10,  2,
i18n_8h.html#a7
N_
(
"landscape"
)},
00099         {10,  3,
i18n_8h.html#a7
N_
(
"fast shutter"
)},
00100         {10,  4,
i18n_8h.html#a7
N_
(
"slow shutter"
)},
00101         {10,  5,
i18n_8h.html#a7
N_
(
"night"
)},
00102         {10,  6,
i18n_8h.html#a7
N_
(
"Black & White"
)},
00103         {10,  7,
i18n_8h.html#a7
N_
(
"Sepia"
)},
00104         {10,  8,
i18n_8h.html#a7
N_
(
"Portrait"
)},
00105         {10,  9,
i18n_8h.html#a7
N_
(
"Sports"
)},
00106         {10, 10,
i18n_8h.html#a7
N_
(
"Macro / Close-Up"
)},
00107         {10, 11,
i18n_8h.html#a7
N_
(
"Pan Focus"
)},
00108         {12, 0x0000,
i18n_8h.html#a7
N_
(
"normal"
)},
00109         {12, 0x0001,
i18n_8h.html#a7
N_
(
"high"
)},
00110         {12, 0xffff,
i18n_8h.html#a7
N_
(
"low"
)},
00111         {13, 0x0000,
i18n_8h.html#a7
N_
(
"normal"
)},
00112         {13, 0x0001,
i18n_8h.html#a7
N_
(
"high"
)},
00113         {13, 0xffff,
i18n_8h.html#a7
N_
(
"low"
)},
00114         {14, 0x0000,
i18n_8h.html#a7
N_
(
"normal"
)},
00115         {14, 0x0001,
i18n_8h.html#a7
N_
(
"high"
)},
00116         {14, 0xffff,
i18n_8h.html#a7
N_
(
"low"
)},
00117         {15, 15,
i18n_8h.html#a7
N_
(
"auto"
)},
00118         {15, 16,
i18n_8h.html#a7
N_
(
"50"
)},
00119         {15, 17,
i18n_8h.html#a7
N_
(
"100"
)},
00120         {15, 18,
i18n_8h.html#a7
N_
(
"200"
)},
00121         {15, 19,
i18n_8h.html#a7
N_
(
"400"
)},
00122         {16,  3,
i18n_8h.html#a7
N_
(
"evaluative"
)},
00123         {16,  4,
i18n_8h.html#a7
N_
(
"partial"
)},
00124         {16,  5,
i18n_8h.html#a7
N_
(
"center-weighted"
)},
00125         {18, 0x3000,
i18n_8h.html#a7
N_
(
"none (manual focus)"
)},
00126         {18, 0x3001,
i18n_8h.html#a7
N_
(
"auto-selected"
)},
00127         {18, 0x3002,
i18n_8h.html#a7
N_
(
"right"
)},
00128         {18, 0x3003,
i18n_8h.html#a7
N_
(
"center"
)},
00129         {18, 0x3004,
i18n_8h.html#a7
N_
(
"left"
)},
00130         {19,  0,
i18n_8h.html#a7
N_
(
"easy shooting"
)},
00131         {19,  1,
i18n_8h.html#a7
N_
(
"program"
)},
00132         {19,  2,
i18n_8h.html#a7
N_
(
"Tv-priority"
)},
00133         {19,  3,
i18n_8h.html#a7
N_
(
"Av-priority"
)},
00134         {19,  4,
i18n_8h.html#a7
N_
(
"manual"
)},
00135         {19,  5,
i18n_8h.html#a7
N_
(
"A-DEP"
)},
00136         {21, 0x001,
i18n_8h.html#a7
N_
(
"Canon EF 50mm f/1.8"
)},
00137         {21, 0x002,
i18n_8h.html#a7
N_
(
"Canon EF 28mm f/2.8"
)},
00138         {21, 0x004,
i18n_8h.html#a7
N_
(
"Sigma UC Zoom 35-135mm f/4-5.6"
)},
00139         {21, 0x006,
i18n_8h.html#a7
N_
(
"Tokina AF193-2 19-35mm f/3.5-4.5"
)},
00140         {21, 0x010,
i18n_8h.html#a7
N_
(
"Sigma 50mm f/2.8 EX or 28mm f/1.8"
)},
00141         {21, 0x011,
i18n_8h.html#a7
N_
(
"Canon EF 35mm f/2"
)},
00142         {21, 0x013,
i18n_8h.html#a7
N_
(
"Canon EF 15mm f/2.8"
)},
00143         {21, 0x021,
i18n_8h.html#a7
N_
(
"Canon EF 80-200mm f/2.8L"
)},
00144         {21, 0x026,
i18n_8h.html#a7
N_
(
"Cosina 100mm f/3.5 Macro AF"
)},
00145         {21, 0x028,
i18n_8h.html#a7
N_
(
"Tamron AF Aspherical 28-200mm f/3.8-5.6"
)},
00146         {21, 0x029,
i18n_8h.html#a7
N_
(
"Canon EF 50mm f/1.8 MkII"
)},
00147         {21, 0x039,
i18n_8h.html#a7
N_
(
"Canon EF 75-300mm f/4-5.6"
)},
00148         {21, 0x040,
i18n_8h.html#a7
N_
(
"Canon EF 28-80mm f/3.5-5.6"
)},
00149         {21, 0x124,
i18n_8h.html#a7
N_
(
"Canon MP-E 65mm f/2.8 1-5x Macro Photo"
)},
00150         {21, 0x125,
i18n_8h.html#a7
N_
(
"Canon TS-E 24mm f/3.5L"
)},
00151         {21, 0x131,
i18n_8h.html#a7
N_
(
"Sigma 17-35mm f2.8-4 EX Aspherical HSM"
)},
00152         {21, 0x135,
i18n_8h.html#a7
N_
(
"Canon EF 200mm f/1.8L"
)},
00153         {21, 0x136,
i18n_8h.html#a7
N_
(
"Canon EF 300mm f/2.8L"
)},
00154         {21, 0x139,
i18n_8h.html#a7
N_
(
"Canon EF 400mm f/2.8L"
)},
00155         {21, 0x141,
i18n_8h.html#a7
N_
(
"Canon EF 500mm f/4.5L"
)},
00156         {21, 0x149,
i18n_8h.html#a7
N_
(
"Canon EF 100mm f/2"
)},
00157         {21, 0x150,
i18n_8h.html#a7
N_
(
"Sigma 20mm EX f/1.8"
)},
00158         {21, 0x151,
i18n_8h.html#a7
N_
(
"Canon EF 200mm f/2.8L"
)},
00159         {21, 0x153,
i18n_8h.html#a7
N_
(
"Canon EF 35-350mm f/3.5-5.6L"
)},
00160         {21, 0x155,
i18n_8h.html#a7
N_
(
"Canon EF 85mm f/1.8 USM"
)},
00161         {21, 0x156,
i18n_8h.html#a7
N_
(
"Canon EF 28-105mm f/3.5-4.5 USM"
)},
00162         {21, 0x160,
i18n_8h.html#a7
N_
(
"Canon EF 20-35mm f/3.5-4.5 USM"
)},
00163         {21, 0x161,
i18n_8h.html#a7
N_
(
"Canon EF 28-70mm f/2.8L or Sigma 24-70mm EX f/2.8"
)},
00164         {21, 0x165,
i18n_8h.html#a7
N_
(
"Canon EF 70-200mm f/2.8 L"
)},
00165         {21, 0x166,
i18n_8h.html#a7
N_
(
"Canon EF 70-200mm f/2.8 L + x1.4"
)},
00166         {21, 0x167,
i18n_8h.html#a7
N_
(
"Canon EF 70-200mm f/2.8 L + x2"
)},
00167         {21, 0x169,
i18n_8h.html#a7
N_
(
"Sigma 15-30mm f/3.5-4.5 EX DG Aspherical"
)},
00168         {21, 0x170,
i18n_8h.html#a7
N_
(
"Canon EF 200mm f/2.8L II"
)},
00169         {21, 0x173,
i18n_8h.html#a7
N_
(
"Canon EF 180mm Macro f/3.5L or Sigma 180mm EX HSM Macro f/3.5"
)},
00170         {21, 0x174,
i18n_8h.html#a7
N_
(
"Canon EF 135mm f/2L"
)},
00171         {21, 0x176,
i18n_8h.html#a7
N_
(
"Canon EF 24-85mm f/3.5-4.5 USM"
)},
00172         {21, 0x177,
i18n_8h.html#a7
N_
(
"Canon EF 300mm f/4L IS"
)},
00173         {21, 0x178,
i18n_8h.html#a7
N_
(
"Canon EF 28-135mm f/3.5-5.6 IS"
)},
00174         {21, 0x180,
i18n_8h.html#a7
N_
(
"Canon EF 35mm f/1.4L"
)},
00175         {21, 0x182,
i18n_8h.html#a7
N_
(
"Canon EF 100-400mm f/4.5-5.6L IS + x2"
)},
00176         {21, 0x183,
i18n_8h.html#a7
N_
(
"Canon EF 100-400mm f/4.5-5.6L IS"
)},
00177         {21, 0x186,
i18n_8h.html#a7
N_
(
"Canon EF 70-200mm f/4L"
)},
00178         {21, 0x190,
i18n_8h.html#a7
N_
(
"Canon EF 100mm f/2.8 Macro"
)},
00179         {21, 0x191,
i18n_8h.html#a7
N_
(
"Canon EF 400mm f/4 DO IS"
)},
00180         {21, 0x197,
i18n_8h.html#a7
N_
(
"Canon EF 75-300mm f/4-5.6 IS"
)},
00181         {21, 0x198,
i18n_8h.html#a7
N_
(
"Canon EF 50mm f/1.4"
)},
00182         {21, 0x202,
i18n_8h.html#a7
N_
(
"Canon EF 28-80 f/3.5-5.6 USM IV"
)},
00183         {21, 0x213,
i18n_8h.html#a7
N_
(
"Canon EF 90-300mm f/4.5-5.6"
)},
00184         {21, 0x229,
i18n_8h.html#a7
N_
(
"Canon EF 16-35mm f/2.8L"
)},
00185         {21, 0x230,
i18n_8h.html#a7
N_
(
"Canon EF 24-70mm f/2.8L"
)},
00186         {21, 0x231,
i18n_8h.html#a7
N_
(
"Canon EF 17-40mm f/4L"
)},
00187   {31,  0,
i18n_8h.html#a7
N_
(
"single"
)},
00188   {31,  1,
i18n_8h.html#a7
N_
(
"continuous"
)},
00189   { 0,  0, NULL}
00190 };
00191
00192
unsigned
int
mnote-canon-entry_8h.html#a1
00193
mnote-canon-entry_8c.html#a8
mnote_canon_entry_count_values
(
const
struct__MnoteCanonEntry.html
MnoteCanonEntry
*entry)
00194 {
00195
unsigned
int
val;
00196
00197
if
(!entry)
return
0;
00198
00199
switch
(entry->
struct__MnoteCanonEntry.html#o0
tag
) {
00200
case
mnote-canon-tag_8h.html#a18a2
MNOTE_CANON_TAG_SETTINGS_1
:
00201
case
mnote-canon-tag_8h.html#a18a4
MNOTE_CANON_TAG_SETTINGS_2
:
00202
case
mnote-canon-tag_8h.html#a18a12
MNOTE_CANON_TAG_CUSTOM_FUNCS
:
00203
if
(entry->
struct__MnoteCanonEntry.html#o1
format
!=
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
)
return
0;
00204
00205                 val =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteCanonEntry.html#o3
data
, entry->
struct__MnoteCanonEntry.html#o5
order
);
00206
/* val is buffer size, i.e. # of values plus 1 */
00207
return
exif-loader_8c.html#a5
MIN
(entry->
struct__MnoteCanonEntry.html#o4
size
- 2, val) / 2;
00208
default
:
00209
return
1;
00210         }
00211 }
00212
00213
char
*
mnote-canon-entry_8h.html#a2
00214
mnote-canon-entry_8c.html#a9
mnote_canon_entry_get_value
(
const
struct__MnoteCanonEntry.html
MnoteCanonEntry
*entry,
unsigned
int
t,
char
*val,
unsigned
int
maxlen)
00215 {
00216
char
buf[128];
00217
exif-utils_8h.html#a6
ExifLong
vl;
00218
exif-utils_8h.html#a4
ExifShort
vs, n;
00219
unsigned
int
j;
00220
unsigned
char
*data = entry->
struct__MnoteCanonEntry.html#o3
data
;
00221
00222
if
(!entry)
return
NULL;
00223
00224         memset (val, 0, maxlen);
00225         maxlen--;
00226
00227
switch
(entry->
struct__MnoteCanonEntry.html#o0
tag
) {
00228
case
mnote-canon-tag_8h.html#a18a2
MNOTE_CANON_TAG_SETTINGS_1
:
00229
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteCanonEntry.html#o1
format
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, val, maxlen);
00230                 n =
exif-utils_8c.html#a2
exif_get_short
(data, entry->
struct__MnoteCanonEntry.html#o5
order
) / 2;
00231
if
(t >= n)
return
NULL;
00232
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteCanonEntry.html#o2
components
, n, val, maxlen);
00233                 vs =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteCanonEntry.html#o3
data
+ 2 + t * 2, entry->
struct__MnoteCanonEntry.html#o5
order
);
00234
switch
(t) {
00235
case
1:
00236
if
(!vs)
break
;
00237                         snprintf (buf,
sizeof
(buf),
i18n_8h.html#a6
_
(
"%i (ms)"
), vs * 100);
00238                         strncpy (val, buf, maxlen - strlen (val));
00239
break
;
00240
case
22:
00241
case
23:
00242                         snprintf (buf,
sizeof
(buf),
"%u"
, vs);
00243                         strncpy (val, buf, maxlen - strlen (val));
00244
break
;
00245
case
24:
00246                         snprintf (buf,
sizeof
(buf),
i18n_8h.html#a6
_
(
"%u mm"
), vs);
00247                         strncpy (val, buf, maxlen - strlen(val));
00248
break
;
00249
case
28:
00250
if
((vs >> 14) & 1)
00251                                 strncpy (val,
i18n_8h.html#a6
_
(
"External E-TTL"
), maxlen - strlen (val));
00252
if
((vs >> 13) & 1)
00253                                 strncpy (val,
i18n_8h.html#a6
_
(
"Internal flash"
), maxlen - strlen (val));
00254
if
((vs >> 11) & 1)
00255                                 strncpy (val,
i18n_8h.html#a6
_
(
"FP sync used"
), maxlen - strlen (val));
00256
if
((vs >> 4) & 1)
00257                                 strncpy (val,
i18n_8h.html#a6
_
(
"FP sync enabled"
), maxlen - strlen (val));
00258
break
;
00259
00260
default
:
00261
for
(j = 0;
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a6
name
&& ((
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a4
subtag
< t) ||
00262                                                 ((
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a4
subtag
== t) &&
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a5
value
<= vs)); j++)
00263
if
((
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a4
subtag
== t) && (
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a5
value
== vs))
break
;
00264
if
((
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a4
subtag
== t) &&
00265                                         (
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a5
value
== vs) &&
mnote-canon-entry_8c.html#a7
entries
[j].
mnote-canon-entry_8c.html#a6
name
)
00266                                 strncpy (val,
mnote-canon-entry_8c.html#a7
entries
[j]. name, maxlen - strlen (val));
00267
else
{
00268                                 snprintf (buf,
sizeof
(buf),
"0x%04x"
, vs);
00269                                 strncpy (val, buf, maxlen - strlen (val));
00270                         }
00271                 }
00272
break
;
00273
00274
case
mnote-canon-tag_8h.html#a18a4
MNOTE_CANON_TAG_SETTINGS_2
:
00275
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteCanonEntry.html#o1
format
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, val, maxlen);
00276                 n =
exif-utils_8c.html#a2
exif_get_short
(data, entry->
struct__MnoteCanonEntry.html#o5
order
) / 2;
00277
if
(t >= n)
return
NULL;
00278
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteCanonEntry.html#o2
components
, n, val, maxlen);
00279                 vs =
exif-utils_8c.html#a2
exif_get_short
(entry->
struct__MnoteCanonEntry.html#o3
data
+ 2 + t * 2, entry->
struct__MnoteCanonEntry.html#o5
order
);
00280
switch
(t) {
00281
case
6:
00282
switch
(vs) {
00283
case
0:
00284                                 strncpy (val,
i18n_8h.html#a6
_
(
"Auto"
), maxlen - strlen (val));
00285
break
;
00286
case
1:
00287                                 strncpy (val,
i18n_8h.html#a6
_
(
"Sunny"
), maxlen - strlen (val));
00288
break
;
00289
case
2:
00290                                 strncpy (val,
i18n_8h.html#a6
_
(
"Cloudy"
), maxlen - strlen (val));
00291
break
;
00292
case
3:
00293                                 strncpy (val,
i18n_8h.html#a6
_
(
"Tungsten"
), maxlen - strlen (val));
00294
break
;
00295
case
4:
00296                                 strncpy (val,
i18n_8h.html#a6
_
(
"Flourescent"
), maxlen - strlen (val));
00297
break
;
00298
case
5:
00299                                 strncpy (val,
i18n_8h.html#a6
_
(
"Flash"
), maxlen - strlen (val));
00300
break
;
00301
case
6:
00302                                 strncpy (val,
i18n_8h.html#a6
_
(
"Custom"
), maxlen - strlen (val));
00303
break
;
00304
default
:
00305                                 snprintf (buf,
sizeof
(buf),
"%i"
, vs);
00306                                 strncpy (val, buf, maxlen - strlen (val));
00307                         }
00308
break
;
00309
case
8:
00310                         snprintf (buf,
sizeof
(buf),
"%u"
, vs);
00311                         strncpy (val, buf, maxlen - strlen (val));
00312
break
;
00313
case
13:
00314
if
(vs >> 12) {
00315
if
(vs & 1)
00316                                         strncpy (val,
i18n_8h.html#a6
_
(
"right"
), maxlen - strlen (val));
00317
if
((vs >> 1) & 1)
00318                                         strncpy (val,
i18n_8h.html#a6
_
(
"center"
), maxlen - strlen (val));
00319
if
((vs >> 2) & 1)
00320                                         strncpy (val,
i18n_8h.html#a6
_
(
"left"
), maxlen - strlen (val));
00321
if
(vs >> 12 == 1)
00322                                         snprintf (buf,
sizeof
(buf),
i18n_8h.html#a6
_
(
" (1 available focus point)"
));
00323
else
00324                                         snprintf (buf,
sizeof
(buf),
i18n_8h.html#a6
_
(
" (%u available focus points)"
), vs >> 12);
00325                                 strncat (val, buf, maxlen - strlen (val));
00326                         }
00327
break
;
00328
case
14:
00329                         snprintf (buf,
sizeof
(buf),
i18n_8h.html#a6
_
(
"%.2f EV"
), vs / 32.);
00330                         strncpy (val, buf, maxlen - strlen (val));
00331
break
;
00332
case
18:
00333                         snprintf (buf,
sizeof
(buf),
i18n_8h.html#a6
_
(
"%u mm"
), vs);
00334                         strncpy (val, buf, maxlen - strlen (val));
00335
break
;
00336
default
:
00337                         snprintf (buf,
sizeof
(buf),
"0x%04x"
, vs);
00338                         strncpy (val, buf, maxlen - strlen (val));
00339
break
;
00340                 }
00341
break
;
00342
00343
case
mnote-canon-tag_8h.html#a18a5
MNOTE_CANON_TAG_IMAGE_TYPE
:
00344
case
mnote-canon-tag_8h.html#a18a8
MNOTE_CANON_TAG_OWNER
:
00345
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteCanonEntry.html#o1
format
,
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
, val, maxlen);
00346
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteCanonEntry.html#o2
components
, 32, val, maxlen);
00347                 strncpy (val, (
char
*)data,
exif-loader_8c.html#a5
MIN
(entry->
struct__MnoteCanonEntry.html#o4
size
, maxlen));
00348
break
;
00349
00350
case
mnote-canon-tag_8h.html#a18a6
MNOTE_CANON_TAG_FIRMWARE
:
00351
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteCanonEntry.html#o1
format
,
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
, val, maxlen);
00352
mnote-canon-entry_8c.html#a2
CC2
(entry->
struct__MnoteCanonEntry.html#o2
components
, 24, 32, val, maxlen);
00353                 strncpy (val, (
char
*)data,
exif-loader_8c.html#a5
MIN
(entry->
struct__MnoteCanonEntry.html#o4
size
, maxlen));
00354
break
;
00355
00356
case
mnote-canon-tag_8h.html#a18a7
MNOTE_CANON_TAG_IMAGE_NUMBER
:
00357
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteCanonEntry.html#o1
format
,
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
, val, maxlen);
00358
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteCanonEntry.html#o2
components
, 1, val, maxlen);
00359                 vl =
exif-utils_8c.html#a7
exif_get_long
(data, entry->
struct__MnoteCanonEntry.html#o5
order
);
00360                 snprintf (val, maxlen,
"%03lu-%04lu"
,
00361                                 (
unsigned
long
) vl/10000,
00362                                 (
unsigned
long
) vl%10000);
00363
break
;
00364
00365
case
mnote-canon-tag_8h.html#a18a10
MNOTE_CANON_TAG_SERIAL_NUMBER
:
00366
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteCanonEntry.html#o1
format
,
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
, val, maxlen);
00367
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteCanonEntry.html#o2
components
, 1, val, maxlen);
00368                 vl =
exif-utils_8c.html#a7
exif_get_long
(data, entry->
struct__MnoteCanonEntry.html#o5
order
);
00369                 snprintf (val, maxlen,
"%04X-%05d"
, (
int
)vl>>16,(
int
)vl&0xffff);
00370
break
;
00371
00372
case
mnote-canon-tag_8h.html#a18a12
MNOTE_CANON_TAG_CUSTOM_FUNCS
:
00373
mnote-canon-entry_8c.html#a0
CF
(entry->
struct__MnoteCanonEntry.html#o1
format
,
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
, val, maxlen);
00374                 n =
exif-utils_8c.html#a2
exif_get_short
(data, entry->
struct__MnoteCanonEntry.html#o5
order
) / 2;
00375
if
(t >= n)
return
NULL;
00376
mnote-canon-entry_8c.html#a1
CC
(entry->
struct__MnoteCanonEntry.html#o2
components
, n, val, maxlen);
00377                 vs =
exif-utils_8c.html#a2
exif_get_short
(data + 2 + 2 * t, entry->
struct__MnoteCanonEntry.html#o5
order
);
00378                 snprintf (buf,
sizeof
(buf),
"%u"
, vs);
00379                 strncat (val, buf, maxlen - strlen (val));
00380
break
;
00381
00382
default
:
00383
#ifdef DEBUG
00384
if
(entry->
struct__MnoteCanonEntry.html#o1
format
==
exif-format_8h.html#a14a2
EXIF_FORMAT_SHORT
)
00385
for
(i=0;i<entry->
struct__MnoteCanonEntry.html#o2
components
;i++) {
00386                         vs =
exif-utils_8c.html#a2
exif_get_short
(data, entry->
struct__MnoteCanonEntry.html#o5
order
);
00387                         data+=2;
00388                         printf (
"Value%d=%d\n"
, i, vs);
00389                 }
00390
else
if
(entry->
struct__MnoteCanonEntry.html#o1
format
==
exif-format_8h.html#a14a3
EXIF_FORMAT_LONG
)
00391
for
(i=0;i<entry->
struct__MnoteCanonEntry.html#o2
components
;i++) {
00392                         vl =
exif-utils_8c.html#a7
exif_get_long
(data, entry->
struct__MnoteCanonEntry.html#o5
order
);
00393                         data+=4;
00394                         printf (
"Value%d=%d\n"
, i, vs);
00395                 }
00396
else
if
(entry->
struct__MnoteCanonEntry.html#o1
format
==
exif-format_8h.html#a14a1
EXIF_FORMAT_ASCII
)
00397                     strncpy (val, data,
exif-loader_8c.html#a5
MIN
(entry->
struct__MnoteCanonEntry.html#o4
size
, maxlen));
00398
#endif
00399
break
;
00400         }
00401
return
val;
00402 }
Generated on Fri Sep 9 16:28:11 2005 for EXIF library (libexif) Internals by
http://www.doxygen.org/index.html
doxygen
1.4.4
