1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.imaging.formats.png;
17
18 import java.util.Collections;
19 import java.util.List;
20
21 import org.apache.commons.imaging.common.XmpImagingParameters;
22
23
24
25
26
27
28 public class PngImagingParameters extends XmpImagingParameters<PngImagingParameters> {
29
30 public static final byte DEFAULT_BIT_DEPTH = 8;
31
32
33
34
35 private byte bitDepth = DEFAULT_BIT_DEPTH;
36
37 private boolean forceIndexedColor;
38
39 private boolean forceTrueColor;
40
41 private boolean predictorEnabled;
42
43
44
45
46
47
48
49
50
51
52 private PhysicalScale physicalScale;
53
54
55
56
57
58
59
60
61
62
63 private List<? extends AbstractPngText> textChunks;
64
65 public byte getBitDepth() {
66 return bitDepth;
67 }
68
69 public PhysicalScale getPhysicalScale() {
70 return physicalScale;
71 }
72
73 public List<? extends AbstractPngText> getTextChunks() {
74 return textChunks != null ? Collections.unmodifiableList(textChunks) : null;
75 }
76
77 public boolean isForceIndexedColor() {
78 return forceIndexedColor;
79 }
80
81 public boolean isForceTrueColor() {
82 return forceTrueColor;
83 }
84
85
86
87
88
89
90 public boolean isPredictorEnabled() {
91 return predictorEnabled;
92 }
93
94 public PngImagingParameters setBitDepth(final byte bitDepth) {
95 this.bitDepth = bitDepth;
96 return asThis();
97 }
98
99 public PngImagingParameters setForceIndexedColor(final boolean forceIndexedColor) {
100 this.forceIndexedColor = forceIndexedColor;
101 return asThis();
102 }
103
104 public PngImagingParameters setForceTrueColor(final boolean forceTrueColor) {
105 this.forceTrueColor = forceTrueColor;
106 return asThis();
107 }
108
109 public PngImagingParameters setPhysicalScale(final PhysicalScale physicalScale) {
110 this.physicalScale = physicalScale;
111 return asThis();
112 }
113
114
115
116
117
118
119
120
121
122 public PngImagingParameters setPredictorEnabled(final boolean predictorEnabled) {
123 this.predictorEnabled = predictorEnabled;
124 return asThis();
125 }
126
127 public PngImagingParameters setTextChunks(final List<? extends AbstractPngText> textChunks) {
128 this.textChunks = Collections.unmodifiableList(textChunks);
129 return asThis();
130 }
131 }