1 | /*
|
---|
2 | * Copyright 2002-2017 Drew Noakes
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | * More information about this project is available at:
|
---|
17 | *
|
---|
18 | * https://drewnoakes.com/code/exif/
|
---|
19 | * https://github.com/drewnoakes/metadata-extractor
|
---|
20 | */
|
---|
21 | package com.drew.metadata.exif.makernotes;
|
---|
22 |
|
---|
23 | import com.drew.lang.annotations.NotNull;
|
---|
24 | import com.drew.metadata.Directory;
|
---|
25 |
|
---|
26 | import java.util.HashMap;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Describes tags specific to Nikon (type 1) cameras. Type-1 is for E-Series cameras prior to (not including) E990.
|
---|
30 | *
|
---|
31 | * There are 3 formats of Nikon's Makernote. Makernote of E700/E800/E900/E900S/E910/E950
|
---|
32 | * starts from ASCII string "Nikon". Data format is the same as IFD, but it starts from
|
---|
33 | * offset 0x08. This is the same as Olympus except start string. Example of actual data
|
---|
34 | * structure is shown below.
|
---|
35 | * <pre><code>
|
---|
36 | * :0000: 4E 69 6B 6F 6E 00 01 00-05 00 02 00 02 00 06 00 Nikon...........
|
---|
37 | * :0010: 00 00 EC 02 00 00 03 00-03 00 01 00 00 00 06 00 ................
|
---|
38 | * </code></pre>
|
---|
39 | *
|
---|
40 | * @author Drew Noakes https://drewnoakes.com
|
---|
41 | */
|
---|
42 | @SuppressWarnings("WeakerAccess")
|
---|
43 | public class NikonType1MakernoteDirectory extends Directory
|
---|
44 | {
|
---|
45 | public static final int TAG_UNKNOWN_1 = 0x0002;
|
---|
46 | public static final int TAG_QUALITY = 0x0003;
|
---|
47 | public static final int TAG_COLOR_MODE = 0x0004;
|
---|
48 | public static final int TAG_IMAGE_ADJUSTMENT = 0x0005;
|
---|
49 | public static final int TAG_CCD_SENSITIVITY = 0x0006;
|
---|
50 | public static final int TAG_WHITE_BALANCE = 0x0007;
|
---|
51 | public static final int TAG_FOCUS = 0x0008;
|
---|
52 | public static final int TAG_UNKNOWN_2 = 0x0009;
|
---|
53 | public static final int TAG_DIGITAL_ZOOM = 0x000A;
|
---|
54 | public static final int TAG_CONVERTER = 0x000B;
|
---|
55 | public static final int TAG_UNKNOWN_3 = 0x0F00;
|
---|
56 |
|
---|
57 | @NotNull
|
---|
58 | protected static final HashMap<Integer, String> _tagNameMap = new HashMap<Integer, String>();
|
---|
59 |
|
---|
60 | static
|
---|
61 | {
|
---|
62 | _tagNameMap.put(TAG_CCD_SENSITIVITY, "CCD Sensitivity");
|
---|
63 | _tagNameMap.put(TAG_COLOR_MODE, "Color Mode");
|
---|
64 | _tagNameMap.put(TAG_DIGITAL_ZOOM, "Digital Zoom");
|
---|
65 | _tagNameMap.put(TAG_CONVERTER, "Fisheye Converter");
|
---|
66 | _tagNameMap.put(TAG_FOCUS, "Focus");
|
---|
67 | _tagNameMap.put(TAG_IMAGE_ADJUSTMENT, "Image Adjustment");
|
---|
68 | _tagNameMap.put(TAG_QUALITY, "Quality");
|
---|
69 | _tagNameMap.put(TAG_UNKNOWN_1, "Makernote Unknown 1");
|
---|
70 | _tagNameMap.put(TAG_UNKNOWN_2, "Makernote Unknown 2");
|
---|
71 | _tagNameMap.put(TAG_UNKNOWN_3, "Makernote Unknown 3");
|
---|
72 | _tagNameMap.put(TAG_WHITE_BALANCE, "White Balance");
|
---|
73 | }
|
---|
74 |
|
---|
75 | public NikonType1MakernoteDirectory()
|
---|
76 | {
|
---|
77 | this.setDescriptor(new NikonType1MakernoteDescriptor(this));
|
---|
78 | }
|
---|
79 |
|
---|
80 | @Override
|
---|
81 | @NotNull
|
---|
82 | public String getName()
|
---|
83 | {
|
---|
84 | return "Nikon Makernote";
|
---|
85 | }
|
---|
86 |
|
---|
87 | @Override
|
---|
88 | @NotNull
|
---|
89 | protected HashMap<Integer, String> getTagNameMap()
|
---|
90 | {
|
---|
91 | return _tagNameMap;
|
---|
92 | }
|
---|
93 | }
|
---|