~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/TIFFDecodeParam.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: TIFFDecodeParam.java 750418 2009-03-05 11:03:54Z vhennebert $ */
 
18
/* $Id: TIFFDecodeParam.java 1681698 2015-05-26 07:49:35Z ssteiner $ */
19
19
 
20
20
package org.apache.xmlgraphics.image.codec.tiff;
21
21
 
42
42
 * <code>
43
43
 *       byte b;
44
44
 *       short s;
45
 
 *       s = s & 0xffff;
46
 
 *       b = (byte)((s >> 8) & 0xff);
 
45
 *       s = s &amp; 0xffff;
 
46
 *       b = (byte)((s &gt;&gt; 8) &amp; 0xff);
47
47
 * </code>
48
48
 * If a different algorithm is to be used for the dithering, this class
49
49
 * should be subclassed and an appropriate implementation should be
56
56
 * <code>
57
57
 *       byte b;
58
58
 *       short s;
59
 
 *       b = (byte)((s + Short.MIN_VALUE) >> 8);
 
59
 *       b = (byte)((s + Short.MIN_VALUE) &gt;&gt; 8);
60
60
 * </code>
61
61
 * In order to use a different algorithm for the dithering, this class
62
62
 * should be subclassed and the method overridden.
72
72
 */
73
73
public class TIFFDecodeParam implements ImageDecodeParam {
74
74
 
75
 
    private boolean decodePaletteAsShorts = false;
76
 
    private Long ifdOffset = null;
 
75
    private static final long serialVersionUID = -2371665950056848358L;
 
76
    private boolean decodePaletteAsShorts;
 
77
    private Long ifdOffset;
77
78
    private boolean convertJPEGYCbCrToRGB = true;
78
79
 
79
80
    /** Constructs a default instance of <code>TIFFDecodeParam</code>. */
130
131
     * the directory at that offset.
131
132
     */
132
133
    public void setIFDOffset(long offset) {
133
 
        ifdOffset = new Long(offset);
 
134
        ifdOffset = offset;
134
135
    }
135
136
 
136
137
    /**