Debian Codegraph @

src/com/drew/metadata/pcx/PcxDescriptor.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.pcx;
23
24 import com.drew.lang.annotations.NotNull;
25 import com.drew.lang.annotations.Nullable;
26 import com.drew.metadata.TagDescriptor;
27
28 import static com.drew.metadata.pcx.PcxDirectory.*;
29
30 /**
31 * @author Drew Noakes https://drewnoakes.com
32 */
33 @SuppressWarnings("WeakerAccess")
34 public class PcxDescriptor extends TagDescriptor<PcxDirectory>
35 {
36 public PcxDescriptor(@NotNull PcxDirectory directory)
37 {
38 super(directory);
39 }
40
41 @Override
42 public String getDescription(int tagType)
43 {
44 switch (tagType) {
45 case TAG_VERSION:
46 return getVersionDescription();
47 case TAG_COLOR_PLANES:
48 return getColorPlanesDescription();
49 case TAG_PALETTE_TYPE:
50 return getPaletteTypeDescription();
51 default:
52 return super.getDescription(tagType);
53 }
54 }
55
56 @Nullable
57 public String getVersionDescription()
58 {
59 // Prior to v2.5 of PC Paintbrush, the PCX image file format was considered proprietary information
60 // by ZSoft Corporation
61
62 return getIndexedDescription(TAG_VERSION,
63 "2.5 with fixed EGA palette information",
64 null,
65 "2.8 with modifiable EGA palette information",
66 "2.8 without palette information (default palette)",
67 "PC Paintbrush for Windows",
68 "3.0 or better");
69 }
70
71 @Nullable
72 public String getColorPlanesDescription()
73 {
74 return getIndexedDescription(TAG_COLOR_PLANES, 3,
75 "24-bit color",
76 "16 colors");
77 }
78
79 @Nullable
80 public String getPaletteTypeDescription()
81 {
82 return getIndexedDescription(TAG_PALETTE_TYPE, 1,
83 "Color or B&W",
84 "Grayscale");
85 }
86 }