~hjd/ubuntu/wily/xmlgraphics-commons/debian-merged

« back to all changes in this revision

Viewing changes to src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFEncodeParam.java

  • Committer: Hans Joachim Desserud
  • Date: 2015-11-11 18:22:53 UTC
  • mfrom: (9.1.5 sid)
  • Revision ID: hans_joachim_desserud-20151111182253-zwi0frfm97j0wddn
  * Merge from Debian unstable.  Remaining changes:
    - d/control: Drop dependencies required for unit testing as they
      include libmockito-java which would pull maven into main, disable unit
      test execution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 * limitations under the License.
16
16
 */
17
17
 
18
 
/* $Id: TIFFEncodeParam.java 1311522 2012-04-09 23:37:59Z gadams $ */
 
18
/* $Id: TIFFEncodeParam.java 1681698 2015-05-26 07:49:35Z ssteiner $ */
19
19
 
20
20
package org.apache.xmlgraphics.image.codec.tiff;
21
21
 
45
45
 */
46
46
public class TIFFEncodeParam implements ImageEncodeParam {
47
47
 
48
 
    /** No compression. */
49
 
    public static final int COMPRESSION_NONE          = 1;
50
 
 
51
 
    /**
52
 
     * Modified Huffman Compression (CCITT Group 3 1D facsimile compression).
53
 
     * <p><b>Not currently supported.</b>
54
 
     */
55
 
    public static final int COMPRESSION_GROUP3_1D     = 2;
56
 
 
57
 
    /**
58
 
     * CCITT T.4 bilevel compression (CCITT Group 3 2D facsimile compression).
59
 
     * <p><b>Not currently supported.</b>
60
 
     */
61
 
    public static final int COMPRESSION_GROUP3_2D     = 3;
62
 
 
63
 
    /**
64
 
     * CCITT T.6 bilevel compression (CCITT Group 4 facsimile compression).
65
 
     * <p><b>Not currently supported.</b>
66
 
     */
67
 
    public static final int COMPRESSION_GROUP4        = 4;
68
 
 
69
 
    /**
70
 
     * LZW compression.
71
 
     * <p><b>Not supported.</b>
72
 
     */
73
 
    public static final int COMPRESSION_LZW           = 5;
74
 
 
75
 
    /**
76
 
     * Code for original JPEG-in-TIFF compression which has been
77
 
     * depricated (for many good reasons) in favor of Tech Note 2
78
 
     * JPEG compression (compression scheme 7).
79
 
     * <p><b>Not supported.</b>
80
 
     */
81
 
    public static final int COMPRESSION_JPEG_BROKEN   = 6;
82
 
 
83
 
    /**
84
 
     * <a href="ftp://ftp.sgi.com/graphics/tiff/TTN2.draft.txt">
85
 
     * JPEG-in-TIFF</a> compression.
86
 
     */
87
 
    public static final int COMPRESSION_JPEG_TTN2     = 7;
88
 
 
89
 
    /** Byte-oriented run-length encoding "PackBits" compression. */
90
 
    public static final int COMPRESSION_PACKBITS      = 32773;
91
 
 
92
 
    /**
93
 
     * <a href="http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1951.txt">
94
 
     * DEFLATE</a> lossless compression (also known as "Zip-in-TIFF").
95
 
     */
96
 
    public static final int COMPRESSION_DEFLATE       = 32946;
97
 
 
98
 
    private int compression = COMPRESSION_NONE;
99
 
 
100
 
    private boolean writeTiled = false;
 
48
    private static final long serialVersionUID = 2471949735040024055L;
 
49
    private CompressionValue compression = CompressionValue.NONE;
 
50
 
 
51
    private boolean writeTiled;
101
52
    private int tileWidth;
102
53
    private int tileHeight;
103
54
 
117
68
        //nop
118
69
    }
119
70
 
120
 
    /**
121
 
     * Returns the value of the compression parameter.
122
 
     */
123
 
    public int getCompression() {
 
71
    /** Returns the value of the compression parameter. */
 
72
    public CompressionValue getCompression() {
124
73
        return compression;
125
74
    }
126
75
 
141
90
     *
142
91
     * @param compression    The compression type.
143
92
     */
144
 
    public void setCompression(int compression) {
 
93
    public void setCompression(CompressionValue compression) {
145
94
 
146
95
        switch(compression) {
147
 
        case COMPRESSION_NONE:
148
 
        case COMPRESSION_PACKBITS:
149
 
        case COMPRESSION_DEFLATE:
 
96
        case NONE:
 
97
        case PACKBITS:
 
98
        case DEFLATE:
150
99
            // Do nothing.
151
100
            break;
152
101
        default:
298
247
     * Returns the value set by <code>setExtraFields()</code>.
299
248
     */
300
249
    public TIFFField[] getExtraFields() {
 
250
        if (extraFields == null) {
 
251
            return new TIFFField[0];
 
252
        }
301
253
        return extraFields;
302
254
    }
303
255
}