Debian Codegraph @

src/com/drew/metadata/adobe/AdobeJpegDirectory.java

raw symbols SCIP
1 /*
2 * Copyright 2002-2019 Drew Noakes and contributors
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
22 package com.drew.metadata.adobe;
23
24 import com.drew.lang.annotations.NotNull;
25 import com.drew.metadata.Directory;
26
27 import java.util.HashMap;
28
29 /**
30 * Contains image encoding information for DCT filters, as stored by Adobe.
31 */
32 @SuppressWarnings("WeakerAccess")
33 public class AdobeJpegDirectory extends Directory {
34
35 public static final int TAG_DCT_ENCODE_VERSION = 0;
36 /**
37 * The convention for TAG_APP14_FLAGS0 and TAG_APP14_FLAGS1 is that 0 bits are benign.
38 * 1 bits in TAG_APP14_FLAGS0 pass information that is possibly useful but not essential for decoding.
39 * <p>
40 * 0x8000 bit: Encoder used Blend=1 downsampling
41 */
42 public static final int TAG_APP14_FLAGS0 = 1;
43 /**
44 * The convention for TAG_APP14_FLAGS0 and TAG_APP14_FLAGS1 is that 0 bits are benign.
45 * 1 bits in TAG_APP14_FLAGS1 pass information essential for decoding. DCTDecode could reject a compressed
46 * image, if there are 1 bits in TAG_APP14_FLAGS1 or color transform codes that it cannot interpret.
47 */
48 public static final int TAG_APP14_FLAGS1 = 2;
49 public static final int TAG_COLOR_TRANSFORM = 3;
50
51 private static final HashMap<Integer, String> _tagNameMap = new HashMap<Integer, String>();
52
53 static {
54 _tagNameMap.put(TAG_DCT_ENCODE_VERSION, "DCT Encode Version");
55 _tagNameMap.put(TAG_APP14_FLAGS0, "Flags 0");
56 _tagNameMap.put(TAG_APP14_FLAGS1, "Flags 1");
57 _tagNameMap.put(TAG_COLOR_TRANSFORM, "Color Transform");
58 }
59
60 public AdobeJpegDirectory() {
61 this.setDescriptor(new AdobeJpegDescriptor(this));
62 }
63
64 @NotNull
65 @Override
66 public String getName() {
67 return "Adobe JPEG";
68 }
69
70 @NotNull
71 @Override
72 protected HashMap<Integer, String> getTagNameMap() {
73 return _tagNameMap;
74 }
75 }