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:10:47 using IntelliJ IDEA.
|
---|
16 | */
|
---|
17 | package com.drew.metadata.exif;
|
---|
18 |
|
---|
19 | import com.drew.metadata.Directory;
|
---|
20 |
|
---|
21 | import java.util.HashMap;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * A standard TIFF IFD directory but always uses Motorola (Big-Endian) Byte Alignment.
|
---|
25 | * Makernote data begins after a 6-byte header: "QVC\x00\x00\x00"
|
---|
26 | */
|
---|
27 | public class CasioType2MakernoteDirectory extends Directory
|
---|
28 | {
|
---|
29 | /**
|
---|
30 | * 2 values - x,y dimensions in pixels.
|
---|
31 | */
|
---|
32 | public static final int TAG_CASIO_TYPE2_THUMBNAIL_DIMENSIONS = 0x0002;
|
---|
33 | /**
|
---|
34 | * Size in bytes
|
---|
35 | */
|
---|
36 | public static final int TAG_CASIO_TYPE2_THUMBNAIL_SIZE = 0x0003;
|
---|
37 | /**
|
---|
38 | * Offset of Preview Thumbnail
|
---|
39 | */
|
---|
40 | public static final int TAG_CASIO_TYPE2_THUMBNAIL_OFFSET = 0x0004;
|
---|
41 | /**
|
---|
42 | * 1 = Fine
|
---|
43 | * 2 = Super Fine
|
---|
44 | */
|
---|
45 | public static final int TAG_CASIO_TYPE2_QUALITY_MODE = 0x0008;
|
---|
46 | /**
|
---|
47 | * 0 = 640 x 480 pixels
|
---|
48 | * 4 = 1600 x 1200 pixels
|
---|
49 | * 5 = 2048 x 1536 pixels
|
---|
50 | * 20 = 2288 x 1712 pixels
|
---|
51 | * 21 = 2592 x 1944 pixels
|
---|
52 | * 22 = 2304 x 1728 pixels
|
---|
53 | * 36 = 3008 x 2008 pixels
|
---|
54 | */
|
---|
55 | public static final int TAG_CASIO_TYPE2_IMAGE_SIZE = 0x0009;
|
---|
56 | /**
|
---|
57 | * 0 = Normal
|
---|
58 | * 1 = Macro
|
---|
59 | */
|
---|
60 | public static final int TAG_CASIO_TYPE2_FOCUS_MODE_1 = 0x000D;
|
---|
61 | /**
|
---|
62 | * 3 = 50
|
---|
63 | * 4 = 64
|
---|
64 | * 6 = 100
|
---|
65 | * 9 = 200
|
---|
66 | */
|
---|
67 | public static final int TAG_CASIO_TYPE2_ISO_SENSITIVITY = 0x0014;
|
---|
68 | /**
|
---|
69 | * 0 = Auto
|
---|
70 | * 1 = Daylight
|
---|
71 | * 2 = Shade
|
---|
72 | * 3 = Tungsten
|
---|
73 | * 4 = Fluorescent
|
---|
74 | * 5 = Manual
|
---|
75 | */
|
---|
76 | public static final int TAG_CASIO_TYPE2_WHITE_BALANCE_1 = 0x0019;
|
---|
77 | /**
|
---|
78 | * Units are tenths of a millimetre
|
---|
79 | */
|
---|
80 | public static final int TAG_CASIO_TYPE2_FOCAL_LENGTH = 0x001D;
|
---|
81 | /**
|
---|
82 | * 0 = -1
|
---|
83 | * 1 = Normal
|
---|
84 | * 2 = +1
|
---|
85 | */
|
---|
86 | public static final int TAG_CASIO_TYPE2_SATURATION = 0x001F;
|
---|
87 | /**
|
---|
88 | * 0 = -1
|
---|
89 | * 1 = Normal
|
---|
90 | * 2 = +1
|
---|
91 | */
|
---|
92 | public static final int TAG_CASIO_TYPE2_CONTRAST = 0x0020;
|
---|
93 | /**
|
---|
94 | * 0 = -1
|
---|
95 | * 1 = Normal
|
---|
96 | * 2 = +1
|
---|
97 | */
|
---|
98 | public static final int TAG_CASIO_TYPE2_SHARPNESS = 0x0021;
|
---|
99 | /**
|
---|
100 | * See PIM specification here: http://www.ozhiker.com/electronics/pjmt/jpeg_info/pim.html
|
---|
101 | */
|
---|
102 | public static final int TAG_CASIO_TYPE2_PRINT_IMAGE_MATCHING_INFO = 0x0E00;
|
---|
103 | /**
|
---|
104 | * Alternate thumbnail offset
|
---|
105 | */
|
---|
106 | public static final int TAG_CASIO_TYPE2_CASIO_PREVIEW_THUMBNAIL = 0x2000;
|
---|
107 | /**
|
---|
108 | *
|
---|
109 | */
|
---|
110 | public static final int TAG_CASIO_TYPE2_WHITE_BALANCE_BIAS = 0x2011;
|
---|
111 | /**
|
---|
112 | * 12 = Flash
|
---|
113 | * 0 = Manual
|
---|
114 | * 1 = Auto?
|
---|
115 | * 4 = Flash?
|
---|
116 | */
|
---|
117 | public static final int TAG_CASIO_TYPE2_WHITE_BALANCE_2 = 0x2012;
|
---|
118 | /**
|
---|
119 | * Units are millimetres
|
---|
120 | */
|
---|
121 | public static final int TAG_CASIO_TYPE2_OBJECT_DISTANCE = 0x2022;
|
---|
122 | /**
|
---|
123 | * 0 = Off
|
---|
124 | */
|
---|
125 | public static final int TAG_CASIO_TYPE2_FLASH_DISTANCE = 0x2034;
|
---|
126 | /**
|
---|
127 | * 2 = Normal Mode
|
---|
128 | */
|
---|
129 | public static final int TAG_CASIO_TYPE2_RECORD_MODE = 0x3000;
|
---|
130 | /**
|
---|
131 | * 1 = Off?
|
---|
132 | */
|
---|
133 | public static final int TAG_CASIO_TYPE2_SELF_TIMER = 0x3001;
|
---|
134 | /**
|
---|
135 | * 3 = Fine
|
---|
136 | */
|
---|
137 | public static final int TAG_CASIO_TYPE2_QUALITY = 0x3002;
|
---|
138 | /**
|
---|
139 | * 1 = Fixation
|
---|
140 | * 6 = Multi-Area Auto Focus
|
---|
141 | */
|
---|
142 | public static final int TAG_CASIO_TYPE2_FOCUS_MODE_2 = 0x3003;
|
---|
143 | /**
|
---|
144 | * (string)
|
---|
145 | */
|
---|
146 | public static final int TAG_CASIO_TYPE2_TIME_ZONE = 0x3006;
|
---|
147 | /**
|
---|
148 | *
|
---|
149 | */
|
---|
150 | public static final int TAG_CASIO_TYPE2_BESTSHOT_MODE = 0x3007;
|
---|
151 | /**
|
---|
152 | * 0 = Off
|
---|
153 | * 1 = On?
|
---|
154 | */
|
---|
155 | public static final int TAG_CASIO_TYPE2_CCD_ISO_SENSITIVITY = 0x3014;
|
---|
156 | /**
|
---|
157 | * 0 = Off
|
---|
158 | */
|
---|
159 | public static final int TAG_CASIO_TYPE2_COLOUR_MODE = 0x3015;
|
---|
160 | /**
|
---|
161 | * 0 = Off
|
---|
162 | */
|
---|
163 | public static final int TAG_CASIO_TYPE2_ENHANCEMENT = 0x3016;
|
---|
164 | /**
|
---|
165 | * 0 = Off
|
---|
166 | */
|
---|
167 | public static final int TAG_CASIO_TYPE2_FILTER = 0x3017;
|
---|
168 |
|
---|
169 | protected static final HashMap tagNameMap = new HashMap();
|
---|
170 |
|
---|
171 | static
|
---|
172 | {
|
---|
173 | // TODO add names
|
---|
174 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_THUMBNAIL_DIMENSIONS), "Thumbnail Dimensions");
|
---|
175 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_THUMBNAIL_SIZE), "Thumbnail Size");
|
---|
176 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_THUMBNAIL_OFFSET), "Thumbnail Offset");
|
---|
177 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_QUALITY_MODE), "Quality Mode");
|
---|
178 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_IMAGE_SIZE), "Image Size");
|
---|
179 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_FOCUS_MODE_1), "Focus Mode");
|
---|
180 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_ISO_SENSITIVITY), "ISO Sensitivity");
|
---|
181 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_WHITE_BALANCE_1), "White Balance");
|
---|
182 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_FOCAL_LENGTH), "Focal Length");
|
---|
183 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_SATURATION), "Saturation");
|
---|
184 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_CONTRAST), "Contrast");
|
---|
185 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_SHARPNESS), "Sharpness");
|
---|
186 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_PRINT_IMAGE_MATCHING_INFO), "Print Image Matching (PIM) Info");
|
---|
187 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_CASIO_PREVIEW_THUMBNAIL), "Casio Preview Thumbnail");
|
---|
188 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_WHITE_BALANCE_BIAS), "White Balance Bias");
|
---|
189 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_WHITE_BALANCE_2), "White Balance");
|
---|
190 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_OBJECT_DISTANCE), "Object Distance");
|
---|
191 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_FLASH_DISTANCE), "Flash Distance");
|
---|
192 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_RECORD_MODE), "Record Mode");
|
---|
193 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_SELF_TIMER), "Self Timer");
|
---|
194 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_QUALITY), "Quality");
|
---|
195 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_FOCUS_MODE_2), "Focus Mode");
|
---|
196 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_TIME_ZONE), "Time Zone");
|
---|
197 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_BESTSHOT_MODE), "BestShot Mode");
|
---|
198 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_CCD_ISO_SENSITIVITY), "CCD ISO Sensitivity");
|
---|
199 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_COLOUR_MODE), "Colour Mode");
|
---|
200 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_ENHANCEMENT), "Enhancement");
|
---|
201 | tagNameMap.put(new Integer(TAG_CASIO_TYPE2_FILTER), "Filter");
|
---|
202 | }
|
---|
203 |
|
---|
204 | public CasioType2MakernoteDirectory()
|
---|
205 | {
|
---|
206 | this.setDescriptor(new CasioType2MakernoteDescriptor(this));
|
---|
207 | }
|
---|
208 |
|
---|
209 | public String getName()
|
---|
210 | {
|
---|
211 | return "Casio Makernote";
|
---|
212 | }
|
---|
213 |
|
---|
214 | protected HashMap getTagNameMap()
|
---|
215 | {
|
---|
216 | return tagNameMap;
|
---|
217 | }
|
---|
218 | }
|
---|