< prev index next >
src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFFaxDecompressor.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 69,85 ****
private int lineBitNum;
// Data structures needed to store changing elements for the previous
// and the current scanline
private int changingElemSize = 0;
! private int prevChangingElems[];
! private int currChangingElems[];
// Element at which to start search in getNextChangingElement
private int lastChangingElement = 0;
! private static int table1[] = {
0x00, // 0 bits are left in first byte - SHOULD NOT HAPPEN
0x01, // 1 bits are left in first byte
0x03, // 2 bits are left in first byte
0x07, // 3 bits are left in first byte
0x0f, // 4 bits are left in first byte
--- 69,85 ----
private int lineBitNum;
// Data structures needed to store changing elements for the previous
// and the current scanline
private int changingElemSize = 0;
! private int[] prevChangingElems;
! private int[] currChangingElems;
// Element at which to start search in getNextChangingElement
private int lastChangingElement = 0;
! private static int[] table1 = {
0x00, // 0 bits are left in first byte - SHOULD NOT HAPPEN
0x01, // 1 bits are left in first byte
0x03, // 2 bits are left in first byte
0x07, // 3 bits are left in first byte
0x0f, // 4 bits are left in first byte
*** 87,97 ****
0x3f, // 6 bits are left in first byte
0x7f, // 7 bits are left in first byte
0xff // 8 bits are left in first byte
};
! private static int table2[] = {
0x00, // 0
0x80, // 1
0xc0, // 2
0xe0, // 3
0xf0, // 4
--- 87,97 ----
0x3f, // 6 bits are left in first byte
0x7f, // 7 bits are left in first byte
0xff // 8 bits are left in first byte
};
! private static int[] table2 = {
0x00, // 0
0x80, // 1
0xc0, // 2
0xe0, // 3
0xf0, // 4
*** 101,111 ****
0xff // 8
};
// Table to be used for flipping bytes when fillOrder is
// BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT (2).
! static byte flipTable[] = {
0, -128, 64, -64, 32, -96, 96, -32,
16, -112, 80, -48, 48, -80, 112, -16,
8, -120, 72, -56, 40, -88, 104, -24,
24, -104, 88, -40, 56, -72, 120, -8,
4, -124, 68, -60, 36, -92, 100, -28,
--- 101,111 ----
0xff // 8
};
// Table to be used for flipping bytes when fillOrder is
// BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT (2).
! static byte[] flipTable = {
0, -128, 64, -64, 32, -96, 96, -32,
16, -112, 80, -48, 48, -80, 112, -16,
8, -120, 72, -56, 40, -88, 104, -24,
24, -104, 88, -40, 56, -72, 120, -8,
4, -124, 68, -60, 36, -92, 100, -28,
*** 137,147 ****
15, -113, 79, -49, 47, -81, 111, -17,
31, -97, 95, -33, 63, -65, 127, -1,
};
// The main 10 bit white runs lookup table
! private static short white[] = {
// 0 - 7
6430, 6400, 6400, 6400, 3225, 3225, 3225, 3225,
// 8 - 15
944, 944, 944, 944, 976, 976, 976, 976,
// 16 - 23
--- 137,147 ----
15, -113, 79, -49, 47, -81, 111, -17,
31, -97, 95, -33, 63, -65, 127, -1,
};
// The main 10 bit white runs lookup table
! private static short[] white = {
// 0 - 7
6430, 6400, 6400, 6400, 3225, 3225, 3225, 3225,
// 8 - 15
944, 944, 944, 944, 976, 976, 976, 976,
// 16 - 23
*** 397,426 ****
// 1016 - 1023
232, 232, 232, 232, 232, 232, 232, 232,
};
// Additional make up codes for both White and Black runs
! private static short additionalMakeup[] = {
28679, 28679, 31752, (short)32777,
(short)33801, (short)34825, (short)35849, (short)36873,
(short)29703, (short)29703, (short)30727, (short)30727,
(short)37897, (short)38921, (short)39945, (short)40969
};
// Initial black run look up table, uses the first 4 bits of a code
! private static short initBlack[] = {
// 0 - 7
3226, 6412, 200, 168, 38, 38, 134, 134,
// 8 - 15
100, 100, 100, 100, 68, 68, 68, 68
};
//
! private static short twoBitBlack[] = {292, 260, 226, 226}; // 0 - 3
// Main black run table, using the last 9 bits of possible 13 bit code
! private static short black[] = {
// 0 - 7
62, 62, 30, 30, 0, 0, 0, 0,
// 8 - 15
0, 0, 0, 0, 0, 0, 0, 0,
// 16 - 23
--- 397,426 ----
// 1016 - 1023
232, 232, 232, 232, 232, 232, 232, 232,
};
// Additional make up codes for both White and Black runs
! private static short[] additionalMakeup = {
28679, 28679, 31752, (short)32777,
(short)33801, (short)34825, (short)35849, (short)36873,
(short)29703, (short)29703, (short)30727, (short)30727,
(short)37897, (short)38921, (short)39945, (short)40969
};
// Initial black run look up table, uses the first 4 bits of a code
! private static short[] initBlack = {
// 0 - 7
3226, 6412, 200, 168, 38, 38, 134, 134,
// 8 - 15
100, 100, 100, 100, 68, 68, 68, 68
};
//
! private static short[] twoBitBlack = {292, 260, 226, 226}; // 0 - 3
// Main black run table, using the last 9 bits of possible 13 bit code
! private static short[] black = {
// 0 - 7
62, 62, 30, 30, 0, 0, 0, 0,
// 8 - 15
0, 0, 0, 0, 0, 0, 0, 0,
// 16 - 23
*** 547,557 ****
390, 390, 390, 390, 390, 390, 390, 390,
// 504 - 511
390, 390, 390, 390, 390, 390, 390, 390,
};
! private static byte twoDCodes[] = {
// 0 - 7
80, 88, 23, 71, 30, 30, 62, 62,
// 8 - 15
4, 4, 4, 4, 4, 4, 4, 4,
// 16 - 23
--- 547,557 ----
390, 390, 390, 390, 390, 390, 390, 390,
// 504 - 511
390, 390, 390, 390, 390, 390, 390, 390,
};
! private static byte[] twoDCodes = {
// 0 - 7
80, 88, 23, 71, 30, 30, 62, 62,
// 8 - 15
4, 4, 4, 4, 4, 4, 4, 4,
// 16 - 23
*** 851,861 ****
int a0, a1, b1, b2;
int[] b = new int[2];
int entry, code, bits, color;
boolean isWhite;
int currIndex = 0;
! int temp[];
if(data.length < 2) {
throw new IIOException("Insufficient data to read initial EOL.");
}
--- 851,861 ----
int a0, a1, b1, b2;
int[] b = new int[2];
int entry, code, bits, color;
boolean isWhite;
int currIndex = 0;
! int[] temp;
if(data.length < 2) {
throw new IIOException("Insufficient data to read initial EOL.");
}
*** 1027,1037 ****
int a0, a1, b1, b2;
int entry, code, bits;
byte color;
boolean isWhite;
int currIndex;
! int temp[];
// Return values from getNextChangingElement
int[] b = new int[2];
// uncompressedMode - have written some code for this, but this
--- 1027,1037 ----
int a0, a1, b1, b2;
int entry, code, bits;
byte color;
boolean isWhite;
int currIndex;
! int[] temp;
// Return values from getNextChangingElement
int[] b = new int[2];
// uncompressedMode - have written some code for this, but this
< prev index next >