00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <config.h>
00022 #include "mnote-canon-tag.h"
00023
00024 #include <stdlib.h>
00025
00026 #include <libexif/i18n.h>
00027
00028 static const struct {
00029 MnoteCanonTag tag;
00030 const char *name;
00031 const char *title;
00032 const char *description;
00033 } table[] = {
00034 #ifndef NO_VERBOSE_TAG_STRINGS
00035 {MNOTE_CANON_TAG_SETTINGS_1, "Settings1", N_("Settings (First Part)"), ""},
00036 {MNOTE_CANON_TAG_FOCAL_LENGTH, "FocalLength", N_("Focal Length"), ""},
00037 {MNOTE_CANON_TAG_SETTINGS_2, "Settings2", N_("Settings (Second Part)"), ""},
00038 {MNOTE_CANON_TAG_PANORAMA, "Panorama", N_("Panorama"), ""},
00039 {MNOTE_CANON_TAG_IMAGE_TYPE, "ImageType", N_("Image Type"), ""},
00040 {MNOTE_CANON_TAG_FIRMWARE, "FirmwareVersion", N_("Firmware Version"), ""},
00041 {MNOTE_CANON_TAG_IMAGE_NUMBER, "ImageNumber", N_("Image Number"), ""},
00042 {MNOTE_CANON_TAG_OWNER, "OwnerName", N_("Owner Name"), ""},
00043 {MNOTE_CANON_TAG_COLOR_INFORMATION, "ColorInformation", N_("Color Information"), ""},
00044 {MNOTE_CANON_TAG_SERIAL_NUMBER, "SerialNumber", N_("Serial Number"), ""},
00045 {MNOTE_CANON_TAG_CUSTOM_FUNCS, "CustomFunctions", N_("Custom Functions"), ""},
00046 #endif
00047 {0, NULL, NULL, NULL}
00048 };
00049
00050 static const struct {
00051 MnoteCanonTag tag;
00052 unsigned int subtag;
00053 const char *name;
00054 } table_sub[] = {
00055 #ifndef NO_VERBOSE_TAG_STRINGS
00056 {MNOTE_CANON_TAG_SETTINGS_1, 0, N_("Macro Mode")},
00057 {MNOTE_CANON_TAG_SETTINGS_1, 1, N_("Self-timer")},
00058 {MNOTE_CANON_TAG_SETTINGS_1, 2, N_("Quality")},
00059 {MNOTE_CANON_TAG_SETTINGS_1, 3, N_("Flash Mode")},
00060 {MNOTE_CANON_TAG_SETTINGS_1, 4, N_("Drive Mode")},
00061 {MNOTE_CANON_TAG_SETTINGS_1, 6, N_("Focus Mode")},
00062 {MNOTE_CANON_TAG_SETTINGS_1, 8, N_("Record Mode")},
00063 {MNOTE_CANON_TAG_SETTINGS_1, 9, N_("Image Size")},
00064 {MNOTE_CANON_TAG_SETTINGS_1, 10, N_("Easy Shooting Mode")},
00065 {MNOTE_CANON_TAG_SETTINGS_1, 11, N_("Digital Zoom")},
00066 {MNOTE_CANON_TAG_SETTINGS_1, 12, N_("Contrast")},
00067 {MNOTE_CANON_TAG_SETTINGS_1, 13, N_("Saturation")},
00068 {MNOTE_CANON_TAG_SETTINGS_1, 14, N_("Sharpness")},
00069 {MNOTE_CANON_TAG_SETTINGS_1, 15, N_("ISO")},
00070 {MNOTE_CANON_TAG_SETTINGS_1, 16, N_("Metering Mode")},
00071 {MNOTE_CANON_TAG_SETTINGS_1, 17, N_("Focus Range")},
00072 {MNOTE_CANON_TAG_SETTINGS_1, 18, N_("AF Point")},
00073 {MNOTE_CANON_TAG_SETTINGS_1, 19, N_("Exposure Mode")},
00074 {MNOTE_CANON_TAG_SETTINGS_1, 21, N_("Lens Type")},
00075 {MNOTE_CANON_TAG_SETTINGS_1, 22, N_("Long Focal Length of Lens")},
00076 {MNOTE_CANON_TAG_SETTINGS_1, 23, N_("Short Focal Length of Lens")},
00077 {MNOTE_CANON_TAG_SETTINGS_1, 24, N_("Focal Units per mm")},
00078 {MNOTE_CANON_TAG_SETTINGS_1, 25, N_("Maximal Aperture")},
00079 {MNOTE_CANON_TAG_SETTINGS_1, 26, N_("Minimal Aperture")},
00080 {MNOTE_CANON_TAG_SETTINGS_1, 27, N_("Flash Activity")},
00081 {MNOTE_CANON_TAG_SETTINGS_1, 28, N_("Flash Details")},
00082 {MNOTE_CANON_TAG_SETTINGS_1, 31, N_("Focus Mode")},
00083 {MNOTE_CANON_TAG_SETTINGS_1, 32, N_("AE Setting")},
00084 {MNOTE_CANON_TAG_SETTINGS_1, 33, N_("Image Stabilization")},
00085 {MNOTE_CANON_TAG_SETTINGS_1, 34, N_("Display Aperture")},
00086 {MNOTE_CANON_TAG_SETTINGS_1, 35, N_("Zoom Source Width")},
00087 {MNOTE_CANON_TAG_SETTINGS_1, 36, N_("Zoom Target Width")},
00088 {MNOTE_CANON_TAG_SETTINGS_1, 39, N_("Photo Effect")},
00089 {MNOTE_CANON_TAG_SETTINGS_1, 40, N_("Manual Flash Output")},
00090 {MNOTE_CANON_TAG_SETTINGS_1, 41, N_("Color Tone")},
00091 {MNOTE_CANON_TAG_FOCAL_LENGTH, 0, N_("Focal Type")},
00092 {MNOTE_CANON_TAG_FOCAL_LENGTH, 1, N_("Focal Length")},
00093 {MNOTE_CANON_TAG_FOCAL_LENGTH, 2, N_("Focal Plane X Size")},
00094 {MNOTE_CANON_TAG_FOCAL_LENGTH, 3, N_("Focal Plane Y Size")},
00095 {MNOTE_CANON_TAG_SETTINGS_2, 0, N_("Auto ISO")},
00096 {MNOTE_CANON_TAG_SETTINGS_2, 1, N_("Shot ISO")},
00097 {MNOTE_CANON_TAG_SETTINGS_2, 2, N_("Measured EV")},
00098 {MNOTE_CANON_TAG_SETTINGS_2, 3, N_("Target Aperture")},
00099 {MNOTE_CANON_TAG_SETTINGS_2, 4, N_("Target Exposure Time")},
00100 {MNOTE_CANON_TAG_SETTINGS_2, 5, N_("Exposure Compensation")},
00101 {MNOTE_CANON_TAG_SETTINGS_2, 6, N_("White Balance")},
00102 {MNOTE_CANON_TAG_SETTINGS_2, 7, N_("Slow Shutter")},
00103 {MNOTE_CANON_TAG_SETTINGS_2, 8, N_("Sequence Number")},
00104 {MNOTE_CANON_TAG_SETTINGS_2, 12, N_("Flash Guide Number")},
00105 {MNOTE_CANON_TAG_SETTINGS_2, 13, N_("AF Point")},
00106 {MNOTE_CANON_TAG_SETTINGS_2, 14, N_("Flash Exposure Compensation")},
00107 {MNOTE_CANON_TAG_SETTINGS_2, 15, N_("AE Bracketing")},
00108 {MNOTE_CANON_TAG_SETTINGS_2, 16, N_("AE Bracket Value")},
00109 {MNOTE_CANON_TAG_SETTINGS_2, 18, N_("Focus Distance Upper")},
00110 {MNOTE_CANON_TAG_SETTINGS_2, 19, N_("Focus Distance Lower")},
00111 {MNOTE_CANON_TAG_SETTINGS_2, 20, N_("FNumber")},
00112 {MNOTE_CANON_TAG_SETTINGS_2, 21, N_("Exposure Time")},
00113 {MNOTE_CANON_TAG_SETTINGS_2, 23, N_("Bulb Duration")},
00114 {MNOTE_CANON_TAG_SETTINGS_2, 25, N_("Camera Type")},
00115 {MNOTE_CANON_TAG_SETTINGS_2, 26, N_("Auto Rotate")},
00116 {MNOTE_CANON_TAG_SETTINGS_2, 27, N_("ND Filter")},
00117 {MNOTE_CANON_TAG_SETTINGS_2, 28, N_("Self-timer")},
00118 {MNOTE_CANON_TAG_SETTINGS_2, 32, N_("Manual Flash Output")},
00119 {MNOTE_CANON_TAG_PANORAMA, 2, N_("Panorama Frame")},
00120 {MNOTE_CANON_TAG_PANORAMA, 5, N_("Panorama Direction")},
00121 {MNOTE_CANON_TAG_COLOR_INFORMATION, 0, N_("Tone Curve")},
00122 {MNOTE_CANON_TAG_COLOR_INFORMATION, 2, N_("Sharpness Frequency")},
00123 {MNOTE_CANON_TAG_COLOR_INFORMATION, 7, N_("White Balance")},
00124 {MNOTE_CANON_TAG_COLOR_INFORMATION, 9, N_("Picture Style")},
00125 #endif
00126 {0, 0, NULL}
00127 };
00128
00129 const char *
00130 mnote_canon_tag_get_name (MnoteCanonTag t)
00131 {
00132 unsigned int i;
00133
00134 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
00135 if (table[i].tag == t) return table[i].name;
00136 return NULL;
00137 }
00138
00139 const char *
00140 mnote_canon_tag_get_name_sub (MnoteCanonTag t, unsigned int s, ExifDataOption o)
00141 {
00142 unsigned int i;
00143 int tag_found = 0;
00144
00145 for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++) {
00146 if (table_sub[i].tag == t) {
00147 if (table_sub[i].subtag == s)
00148 return table_sub[i].name;
00149 tag_found = 1;
00150 }
00151 }
00152 if (!tag_found || !(o & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS))
00153 return mnote_canon_tag_get_name (t);
00154 else
00155 return NULL;
00156 }
00157
00158 const char *
00159 mnote_canon_tag_get_title (MnoteCanonTag t)
00160 {
00161 unsigned int i;
00162
00163 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
00164 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
00165 if (table[i].tag == t) return (_(table[i].title));
00166 return NULL;
00167 }
00168
00169 const char *
00170 mnote_canon_tag_get_title_sub (MnoteCanonTag t, unsigned int s, ExifDataOption o)
00171 {
00172 unsigned int i;
00173 int tag_found = 0;
00174
00175 for (i = 0; i < sizeof (table_sub) / sizeof (table_sub[0]); i++) {
00176 if (table_sub[i].tag == t) {
00177 if (table_sub[i].subtag == s)
00178 return _(table_sub[i].name);
00179 tag_found = 1;
00180 }
00181 }
00182 if (!tag_found || !(o & EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS))
00183 return mnote_canon_tag_get_title (t);
00184 else
00185 return NULL;
00186 }
00187
00188 const char *
00189 mnote_canon_tag_get_description (MnoteCanonTag t)
00190 {
00191 unsigned int i;
00192
00193 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
00194 if (table[i].tag == t) {
00195 if (!table[i].description || !*table[i].description)
00196 return "";
00197 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
00198 return _(table[i].description);
00199 }
00200 return NULL;
00201 }