You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by dv...@apache.org on 2006/11/22 18:29:43 UTC
svn commit: r478249 [4/5] - in
/xmlgraphics/batik/trunk/sources/org/apache/batik: dom/ dom/anim/
dom/events/ dom/svg/ dom/svg12/ dom/traversal/ dom/util/ ext/awt/font/
ext/awt/g2d/ ext/awt/geom/ ext/awt/image/ ext/awt/image/codec/png/
ext/awt/image/cod...
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFFaxDecoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFFaxDecoder.java?view=diff&rev=478249&r1=478248&r2=478249
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFFaxDecoder.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFFaxDecoder.java Wed Nov 22 09:29:37 2006
@@ -29,8 +29,8 @@
// Data structures needed to store changing elements for the previous
// and the current scanline
private int changingElemSize = 0;
- private int prevChangingElems[];
- private int currChangingElems[];
+ private int[] prevChangingElems;
+ private int[] currChangingElems;
// Element at which to start search in getNextChangingElement
private int lastChangingElement = 0;
@@ -42,7 +42,7 @@
private int fillBits = 0;
private int oneD;
- static int table1[] = {
+ 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
@@ -53,8 +53,8 @@
0x7f, // 7 bits are left in first byte
0xff // 8 bits are left in first byte
};
-
- static int table2[] = {
+
+ static int[] table2 = {
0x00, // 0
0x80, // 1
0xc0, // 2
@@ -67,485 +67,485 @@
};
// Table to be used when fillOrder = 2, for flipping bytes.
- 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,
- 20, -108, 84, -44, 52, -76, 116, -12,
- 12, -116, 76, -52, 44, -84, 108, -20,
- 28, -100, 92, -36, 60, -68, 124, -4,
- 2, -126, 66, -62, 34, -94, 98, -30,
- 18, -110, 82, -46, 50, -78, 114, -14,
- 10, -118, 74, -54, 42, -86, 106, -22,
- 26, -102, 90, -38, 58, -70, 122, -6,
- 6, -122, 70, -58, 38, -90, 102, -26,
- 22, -106, 86, -42, 54, -74, 118, -10,
- 14, -114, 78, -50, 46, -82, 110, -18,
- 30, -98, 94, -34, 62, -66, 126, -2,
- 1, -127, 65, -63, 33, -95, 97, -31,
- 17, -111, 81, -47, 49, -79, 113, -15,
- 9, -119, 73, -55, 41, -87, 105, -23,
- 25, -103, 89, -39, 57, -71, 121, -7,
- 5, -123, 69, -59, 37, -91, 101, -27,
- 21, -107, 85, -43, 53, -75, 117, -11,
- 13, -115, 77, -51, 45, -83, 109, -19,
- 29, -99, 93, -35, 61, -67, 125, -3,
- 3, -125, 67, -61, 35, -93, 99, -29,
- 19, -109, 83, -45, 51, -77, 115, -13,
- 11, -117, 75, -53, 43, -85, 107, -21,
- 27, -101, 91, -37, 59, -69, 123, -5,
- 7, -121, 71, -57, 39, -89, 103, -25,
- 23, -105, 87, -41, 55, -73, 119, -9,
- 15, -113, 79, -49, 47, -81, 111, -17,
- 31, -97, 95, -33, 63, -65, 127, -1,
+ 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,
+ 20, -108, 84, -44, 52, -76, 116, -12,
+ 12, -116, 76, -52, 44, -84, 108, -20,
+ 28, -100, 92, -36, 60, -68, 124, -4,
+ 2, -126, 66, -62, 34, -94, 98, -30,
+ 18, -110, 82, -46, 50, -78, 114, -14,
+ 10, -118, 74, -54, 42, -86, 106, -22,
+ 26, -102, 90, -38, 58, -70, 122, -6,
+ 6, -122, 70, -58, 38, -90, 102, -26,
+ 22, -106, 86, -42, 54, -74, 118, -10,
+ 14, -114, 78, -50, 46, -82, 110, -18,
+ 30, -98, 94, -34, 62, -66, 126, -2,
+ 1, -127, 65, -63, 33, -95, 97, -31,
+ 17, -111, 81, -47, 49, -79, 113, -15,
+ 9, -119, 73, -55, 41, -87, 105, -23,
+ 25, -103, 89, -39, 57, -71, 121, -7,
+ 5, -123, 69, -59, 37, -91, 101, -27,
+ 21, -107, 85, -43, 53, -75, 117, -11,
+ 13, -115, 77, -51, 45, -83, 109, -19,
+ 29, -99, 93, -35, 61, -67, 125, -3,
+ 3, -125, 67, -61, 35, -93, 99, -29,
+ 19, -109, 83, -45, 51, -77, 115, -13,
+ 11, -117, 75, -53, 43, -85, 107, -21,
+ 27, -101, 91, -37, 59, -69, 123, -5,
+ 7, -121, 71, -57, 39, -89, 103, -25,
+ 23, -105, 87, -41, 55, -73, 119, -9,
+ 15, -113, 79, -49, 47, -81, 111, -17,
+ 31, -97, 95, -33, 63, -65, 127, -1,
};
-
+
// The main 10 bit white runs lookup table
- static short white[] = {
+ static short[] white = {
// 0 - 7
- 6430, 6400, 6400, 6400, 3225, 3225, 3225, 3225,
+ 6430, 6400, 6400, 6400, 3225, 3225, 3225, 3225,
// 8 - 15
- 944, 944, 944, 944, 976, 976, 976, 976,
+ 944, 944, 944, 944, 976, 976, 976, 976,
// 16 - 23
- 1456, 1456, 1456, 1456, 1488, 1488, 1488, 1488,
+ 1456, 1456, 1456, 1456, 1488, 1488, 1488, 1488,
// 24 - 31
- 718, 718, 718, 718, 718, 718, 718, 718,
+ 718, 718, 718, 718, 718, 718, 718, 718,
// 32 - 39
- 750, 750, 750, 750, 750, 750, 750, 750,
+ 750, 750, 750, 750, 750, 750, 750, 750,
// 40 - 47
- 1520, 1520, 1520, 1520, 1552, 1552, 1552, 1552,
+ 1520, 1520, 1520, 1520, 1552, 1552, 1552, 1552,
// 48 - 55
- 428, 428, 428, 428, 428, 428, 428, 428,
+ 428, 428, 428, 428, 428, 428, 428, 428,
// 56 - 63
- 428, 428, 428, 428, 428, 428, 428, 428,
+ 428, 428, 428, 428, 428, 428, 428, 428,
// 64 - 71
- 654, 654, 654, 654, 654, 654, 654, 654,
+ 654, 654, 654, 654, 654, 654, 654, 654,
// 72 - 79
- 1072, 1072, 1072, 1072, 1104, 1104, 1104, 1104,
+ 1072, 1072, 1072, 1072, 1104, 1104, 1104, 1104,
// 80 - 87
- 1136, 1136, 1136, 1136, 1168, 1168, 1168, 1168,
+ 1136, 1136, 1136, 1136, 1168, 1168, 1168, 1168,
// 88 - 95
- 1200, 1200, 1200, 1200, 1232, 1232, 1232, 1232,
+ 1200, 1200, 1200, 1200, 1232, 1232, 1232, 1232,
// 96 - 103
- 622, 622, 622, 622, 622, 622, 622, 622,
+ 622, 622, 622, 622, 622, 622, 622, 622,
// 104 - 111
- 1008, 1008, 1008, 1008, 1040, 1040, 1040, 1040,
+ 1008, 1008, 1008, 1008, 1040, 1040, 1040, 1040,
// 112 - 119
- 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44,
// 120 - 127
- 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44,
// 128 - 135
- 396, 396, 396, 396, 396, 396, 396, 396,
+ 396, 396, 396, 396, 396, 396, 396, 396,
// 136 - 143
- 396, 396, 396, 396, 396, 396, 396, 396,
+ 396, 396, 396, 396, 396, 396, 396, 396,
// 144 - 151
- 1712, 1712, 1712, 1712, 1744, 1744, 1744, 1744,
+ 1712, 1712, 1712, 1712, 1744, 1744, 1744, 1744,
// 152 - 159
- 846, 846, 846, 846, 846, 846, 846, 846,
+ 846, 846, 846, 846, 846, 846, 846, 846,
// 160 - 167
- 1264, 1264, 1264, 1264, 1296, 1296, 1296, 1296,
+ 1264, 1264, 1264, 1264, 1296, 1296, 1296, 1296,
// 168 - 175
- 1328, 1328, 1328, 1328, 1360, 1360, 1360, 1360,
+ 1328, 1328, 1328, 1328, 1360, 1360, 1360, 1360,
// 176 - 183
- 1392, 1392, 1392, 1392, 1424, 1424, 1424, 1424,
+ 1392, 1392, 1392, 1392, 1424, 1424, 1424, 1424,
// 184 - 191
- 686, 686, 686, 686, 686, 686, 686, 686,
+ 686, 686, 686, 686, 686, 686, 686, 686,
// 192 - 199
- 910, 910, 910, 910, 910, 910, 910, 910,
+ 910, 910, 910, 910, 910, 910, 910, 910,
// 200 - 207
- 1968, 1968, 1968, 1968, 2000, 2000, 2000, 2000,
+ 1968, 1968, 1968, 1968, 2000, 2000, 2000, 2000,
// 208 - 215
- 2032, 2032, 2032, 2032, 16, 16, 16, 16,
+ 2032, 2032, 2032, 2032, 16, 16, 16, 16,
// 216 - 223
- 10257, 10257, 10257, 10257, 12305, 12305, 12305, 12305,
+ 10257, 10257, 10257, 10257, 12305, 12305, 12305, 12305,
// 224 - 231
- 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330,
// 232 - 239
- 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330,
// 240 - 247
- 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330,
// 248 - 255
- 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330,
// 256 - 263
- 362, 362, 362, 362, 362, 362, 362, 362,
+ 362, 362, 362, 362, 362, 362, 362, 362,
// 264 - 271
- 362, 362, 362, 362, 362, 362, 362, 362,
+ 362, 362, 362, 362, 362, 362, 362, 362,
// 272 - 279
- 362, 362, 362, 362, 362, 362, 362, 362,
+ 362, 362, 362, 362, 362, 362, 362, 362,
// 280 - 287
- 362, 362, 362, 362, 362, 362, 362, 362,
+ 362, 362, 362, 362, 362, 362, 362, 362,
// 288 - 295
- 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
// 296 - 303
- 1904, 1904, 1904, 1904, 1936, 1936, 1936, 1936,
+ 1904, 1904, 1904, 1904, 1936, 1936, 1936, 1936,
// 304 - 311
- -18413, -18413, -16365, -16365, -14317, -14317, -10221, -10221,
+ -18413, -18413, -16365, -16365, -14317, -14317, -10221, -10221,
// 312 - 319
- 590, 590, 590, 590, 590, 590, 590, 590,
+ 590, 590, 590, 590, 590, 590, 590, 590,
// 320 - 327
- 782, 782, 782, 782, 782, 782, 782, 782,
+ 782, 782, 782, 782, 782, 782, 782, 782,
// 328 - 335
- 1584, 1584, 1584, 1584, 1616, 1616, 1616, 1616,
+ 1584, 1584, 1584, 1584, 1616, 1616, 1616, 1616,
// 336 - 343
- 1648, 1648, 1648, 1648, 1680, 1680, 1680, 1680,
+ 1648, 1648, 1648, 1648, 1680, 1680, 1680, 1680,
// 344 - 351
- 814, 814, 814, 814, 814, 814, 814, 814,
+ 814, 814, 814, 814, 814, 814, 814, 814,
// 352 - 359
- 1776, 1776, 1776, 1776, 1808, 1808, 1808, 1808,
+ 1776, 1776, 1776, 1776, 1808, 1808, 1808, 1808,
// 360 - 367
- 1840, 1840, 1840, 1840, 1872, 1872, 1872, 1872,
+ 1840, 1840, 1840, 1840, 1872, 1872, 1872, 1872,
// 368 - 375
- 6157, 6157, 6157, 6157, 6157, 6157, 6157, 6157,
+ 6157, 6157, 6157, 6157, 6157, 6157, 6157, 6157,
// 376 - 383
- 6157, 6157, 6157, 6157, 6157, 6157, 6157, 6157,
+ 6157, 6157, 6157, 6157, 6157, 6157, 6157, 6157,
// 384 - 391
- -12275, -12275, -12275, -12275, -12275, -12275, -12275, -12275,
+ -12275, -12275, -12275, -12275, -12275, -12275, -12275, -12275,
// 392 - 399
- -12275, -12275, -12275, -12275, -12275, -12275, -12275, -12275,
+ -12275, -12275, -12275, -12275, -12275, -12275, -12275, -12275,
// 400 - 407
- 14353, 14353, 14353, 14353, 16401, 16401, 16401, 16401,
+ 14353, 14353, 14353, 14353, 16401, 16401, 16401, 16401,
// 408 - 415
- 22547, 22547, 24595, 24595, 20497, 20497, 20497, 20497,
+ 22547, 22547, 24595, 24595, 20497, 20497, 20497, 20497,
// 416 - 423
- 18449, 18449, 18449, 18449, 26643, 26643, 28691, 28691,
+ 18449, 18449, 18449, 18449, 26643, 26643, 28691, 28691,
// 424 - 431
- 30739, 30739, -32749, -32749, -30701, -30701, -28653, -28653,
+ 30739, 30739, -32749, -32749, -30701, -30701, -28653, -28653,
// 432 - 439
- -26605, -26605, -24557, -24557, -22509, -22509, -20461, -20461,
+ -26605, -26605, -24557, -24557, -22509, -22509, -20461, -20461,
// 440 - 447
- 8207, 8207, 8207, 8207, 8207, 8207, 8207, 8207,
+ 8207, 8207, 8207, 8207, 8207, 8207, 8207, 8207,
// 448 - 455
- 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72,
// 456 - 463
- 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72,
// 464 - 471
- 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72,
// 472 - 479
- 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72,
// 480 - 487
- 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72,
// 488 - 495
- 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72,
// 496 - 503
- 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72,
// 504 - 511
- 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72,
// 512 - 519
- 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104,
// 520 - 527
- 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104,
// 528 - 535
- 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104,
// 536 - 543
- 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104,
// 544 - 551
- 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104,
// 552 - 559
- 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104,
// 560 - 567
- 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104,
// 568 - 575
- 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104,
// 576 - 583
- 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
+ 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
// 584 - 591
- 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
+ 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
// 592 - 599
- 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
+ 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
// 600 - 607
- 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
+ 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
// 608 - 615
- 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266,
// 616 - 623
- 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266,
// 624 - 631
- 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266,
// 632 - 639
- 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266,
// 640 - 647
- 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298,
// 648 - 655
- 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298,
// 656 - 663
- 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298,
// 664 - 671
- 298, 298, 298, 298, 298, 298, 298, 298,
+ 298, 298, 298, 298, 298, 298, 298, 298,
// 672 - 679
- 524, 524, 524, 524, 524, 524, 524, 524,
+ 524, 524, 524, 524, 524, 524, 524, 524,
// 680 - 687
- 524, 524, 524, 524, 524, 524, 524, 524,
+ 524, 524, 524, 524, 524, 524, 524, 524,
// 688 - 695
- 556, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 556, 556, 556, 556, 556, 556,
// 696 - 703
- 556, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 556, 556, 556, 556, 556, 556,
// 704 - 711
- 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136,
// 712 - 719
- 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136,
// 720 - 727
- 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136,
// 728 - 735
- 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136,
// 736 - 743
- 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136,
// 744 - 751
- 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136,
// 752 - 759
- 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136,
// 760 - 767
- 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136,
// 768 - 775
- 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168,
// 776 - 783
- 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168,
// 784 - 791
- 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168,
// 792 - 799
- 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168,
// 800 - 807
- 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168,
// 808 - 815
- 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168,
// 816 - 823
- 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168,
// 824 - 831
- 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168,
// 832 - 839
- 460, 460, 460, 460, 460, 460, 460, 460,
+ 460, 460, 460, 460, 460, 460, 460, 460,
// 840 - 847
- 460, 460, 460, 460, 460, 460, 460, 460,
+ 460, 460, 460, 460, 460, 460, 460, 460,
// 848 - 855
- 492, 492, 492, 492, 492, 492, 492, 492,
+ 492, 492, 492, 492, 492, 492, 492, 492,
// 856 - 863
- 492, 492, 492, 492, 492, 492, 492, 492,
+ 492, 492, 492, 492, 492, 492, 492, 492,
// 864 - 871
- 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
// 872 - 879
- 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
// 880 - 887
- 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
// 888 - 895
- 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
+ 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059,
// 896 - 903
- 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
// 904 - 911
- 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
// 912 - 919
- 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
// 920 - 927
- 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
// 928 - 935
- 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
// 936 - 943
- 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
// 944 - 951
- 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
// 952 - 959
- 200, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 200,
// 960 - 967
- 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232,
// 968 - 975
- 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232,
// 976 - 983
- 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232,
// 984 - 991
- 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232,
// 992 - 999
- 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232,
// 1000 - 1007
- 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232,
// 1008 - 1015
- 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232,
// 1016 - 1023
- 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232,
};
-
+
// Additional make up codes for both White and Black runs
- static short additionalMakeup[] = {
- 28679, 28679, 31752, (short)32777,
+ 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)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
- static short initBlack[] = {
+ static short[] initBlack = {
// 0 - 7
3226, 6412, 200, 168, 38, 38, 134, 134,
// 8 - 15
100, 100, 100, 100, 68, 68, 68, 68
};
- //
- static short twoBitBlack[] = {292, 260, 226, 226}; // 0 - 3
+ //
+ static short[] twoBitBlack = {292, 260, 226, 226}; // 0 - 3
// Main black run table, using the last 9 bits of possible 13 bit code
- static short black[] = {
+ static short[] black = {
// 0 - 7
- 62, 62, 30, 30, 0, 0, 0, 0,
+ 62, 62, 30, 30, 0, 0, 0, 0,
// 8 - 15
- 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
// 16 - 23
- 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
// 24 - 31
- 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
// 32 - 39
- 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225,
+ 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225,
// 40 - 47
- 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225,
+ 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225,
// 48 - 55
- 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225,
+ 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225,
// 56 - 63
- 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225,
+ 3225, 3225, 3225, 3225, 3225, 3225, 3225, 3225,
// 64 - 71
- 588, 588, 588, 588, 588, 588, 588, 588,
+ 588, 588, 588, 588, 588, 588, 588, 588,
// 72 - 79
- 1680, 1680, 20499, 22547, 24595, 26643, 1776, 1776,
+ 1680, 1680, 20499, 22547, 24595, 26643, 1776, 1776,
// 80 - 87
- 1808, 1808, -24557, -22509, -20461, -18413, 1904, 1904,
+ 1808, 1808, -24557, -22509, -20461, -18413, 1904, 1904,
// 88 - 95
- 1936, 1936, -16365, -14317, 782, 782, 782, 782,
+ 1936, 1936, -16365, -14317, 782, 782, 782, 782,
// 96 - 103
- 814, 814, 814, 814, -12269, -10221, 10257, 10257,
+ 814, 814, 814, 814, -12269, -10221, 10257, 10257,
// 104 - 111
- 12305, 12305, 14353, 14353, 16403, 18451, 1712, 1712,
+ 12305, 12305, 14353, 14353, 16403, 18451, 1712, 1712,
// 112 - 119
- 1744, 1744, 28691, 30739, -32749, -30701, -28653, -26605,
+ 1744, 1744, 28691, 30739, -32749, -30701, -28653, -26605,
// 120 - 127
- 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061,
+ 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061,
// 128 - 135
- 424, 424, 424, 424, 424, 424, 424, 424,
+ 424, 424, 424, 424, 424, 424, 424, 424,
// 136 - 143
- 424, 424, 424, 424, 424, 424, 424, 424,
+ 424, 424, 424, 424, 424, 424, 424, 424,
// 144 - 151
- 424, 424, 424, 424, 424, 424, 424, 424,
+ 424, 424, 424, 424, 424, 424, 424, 424,
// 152 - 159
- 424, 424, 424, 424, 424, 424, 424, 424,
+ 424, 424, 424, 424, 424, 424, 424, 424,
// 160 - 167
- 750, 750, 750, 750, 1616, 1616, 1648, 1648,
+ 750, 750, 750, 750, 1616, 1616, 1648, 1648,
// 168 - 175
- 1424, 1424, 1456, 1456, 1488, 1488, 1520, 1520,
+ 1424, 1424, 1456, 1456, 1488, 1488, 1520, 1520,
// 176 - 183
- 1840, 1840, 1872, 1872, 1968, 1968, 8209, 8209,
+ 1840, 1840, 1872, 1872, 1968, 1968, 8209, 8209,
// 184 - 191
- 524, 524, 524, 524, 524, 524, 524, 524,
+ 524, 524, 524, 524, 524, 524, 524, 524,
// 192 - 199
- 556, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 556, 556, 556, 556, 556, 556,
// 200 - 207
- 1552, 1552, 1584, 1584, 2000, 2000, 2032, 2032,
+ 1552, 1552, 1584, 1584, 2000, 2000, 2032, 2032,
// 208 - 215
- 976, 976, 1008, 1008, 1040, 1040, 1072, 1072,
+ 976, 976, 1008, 1008, 1040, 1040, 1072, 1072,
// 216 - 223
- 1296, 1296, 1328, 1328, 718, 718, 718, 718,
+ 1296, 1296, 1328, 1328, 718, 718, 718, 718,
// 224 - 231
- 456, 456, 456, 456, 456, 456, 456, 456,
+ 456, 456, 456, 456, 456, 456, 456, 456,
// 232 - 239
- 456, 456, 456, 456, 456, 456, 456, 456,
+ 456, 456, 456, 456, 456, 456, 456, 456,
// 240 - 247
- 456, 456, 456, 456, 456, 456, 456, 456,
+ 456, 456, 456, 456, 456, 456, 456, 456,
// 248 - 255
- 456, 456, 456, 456, 456, 456, 456, 456,
+ 456, 456, 456, 456, 456, 456, 456, 456,
// 256 - 263
- 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326,
// 264 - 271
- 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326,
// 272 - 279
- 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326,
// 280 - 287
- 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326,
// 288 - 295
- 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326,
// 296 - 303
- 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326,
// 304 - 311
- 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326,
// 312 - 319
- 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326,
// 320 - 327
- 358, 358, 358, 358, 358, 358, 358, 358,
+ 358, 358, 358, 358, 358, 358, 358, 358,
// 328 - 335
- 358, 358, 358, 358, 358, 358, 358, 358,
+ 358, 358, 358, 358, 358, 358, 358, 358,
// 336 - 343
- 358, 358, 358, 358, 358, 358, 358, 358,
+ 358, 358, 358, 358, 358, 358, 358, 358,
// 344 - 351
- 358, 358, 358, 358, 358, 358, 358, 358,
+ 358, 358, 358, 358, 358, 358, 358, 358,
// 352 - 359
- 358, 358, 358, 358, 358, 358, 358, 358,
+ 358, 358, 358, 358, 358, 358, 358, 358,
// 360 - 367
- 358, 358, 358, 358, 358, 358, 358, 358,
+ 358, 358, 358, 358, 358, 358, 358, 358,
// 368 - 375
- 358, 358, 358, 358, 358, 358, 358, 358,
+ 358, 358, 358, 358, 358, 358, 358, 358,
// 376 - 383
- 358, 358, 358, 358, 358, 358, 358, 358,
+ 358, 358, 358, 358, 358, 358, 358, 358,
// 384 - 391
- 490, 490, 490, 490, 490, 490, 490, 490,
+ 490, 490, 490, 490, 490, 490, 490, 490,
// 392 - 399
- 490, 490, 490, 490, 490, 490, 490, 490,
+ 490, 490, 490, 490, 490, 490, 490, 490,
// 400 - 407
- 4113, 4113, 6161, 6161, 848, 848, 880, 880,
+ 4113, 4113, 6161, 6161, 848, 848, 880, 880,
// 408 - 415
- 912, 912, 944, 944, 622, 622, 622, 622,
+ 912, 912, 944, 944, 622, 622, 622, 622,
// 416 - 423
- 654, 654, 654, 654, 1104, 1104, 1136, 1136,
+ 654, 654, 654, 654, 1104, 1104, 1136, 1136,
// 424 - 431
- 1168, 1168, 1200, 1200, 1232, 1232, 1264, 1264,
+ 1168, 1168, 1200, 1200, 1232, 1232, 1264, 1264,
// 432 - 439
- 686, 686, 686, 686, 1360, 1360, 1392, 1392,
+ 686, 686, 686, 686, 1360, 1360, 1392, 1392,
// 440 - 447
- 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12,
// 448 - 455
- 390, 390, 390, 390, 390, 390, 390, 390,
+ 390, 390, 390, 390, 390, 390, 390, 390,
// 456 - 463
- 390, 390, 390, 390, 390, 390, 390, 390,
+ 390, 390, 390, 390, 390, 390, 390, 390,
// 464 - 471
- 390, 390, 390, 390, 390, 390, 390, 390,
+ 390, 390, 390, 390, 390, 390, 390, 390,
// 472 - 479
- 390, 390, 390, 390, 390, 390, 390, 390,
+ 390, 390, 390, 390, 390, 390, 390, 390,
// 480 - 487
- 390, 390, 390, 390, 390, 390, 390, 390,
+ 390, 390, 390, 390, 390, 390, 390, 390,
// 488 - 495
- 390, 390, 390, 390, 390, 390, 390, 390,
+ 390, 390, 390, 390, 390, 390, 390, 390,
// 496 - 503
- 390, 390, 390, 390, 390, 390, 390, 390,
+ 390, 390, 390, 390, 390, 390, 390, 390,
// 504 - 511
- 390, 390, 390, 390, 390, 390, 390, 390,
+ 390, 390, 390, 390, 390, 390, 390, 390,
};
- static byte twoDCodes[] = {
+ static byte[] twoDCodes = {
// 0 - 7
- 80, 88, 23, 71, 30, 30, 62, 62,
+ 80, 88, 23, 71, 30, 30, 62, 62,
// 8 - 15
- 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4,
// 16 - 23
- 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
// 24 - 31
- 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11,
// 32 - 39
- 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
// 40 - 47
- 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35,
// 48 - 55
- 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51,
// 56 - 63
- 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51,
// 64 - 71
- 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41,
// 72 - 79
- 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41,
// 80 - 87
- 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41,
// 88 - 95
- 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41,
// 96 - 103
- 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41,
// 104 - 111
- 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41,
// 112 - 119
- 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41,
// 120 - 127
- 41, 41, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41,
};
/**
@@ -573,7 +573,7 @@
bitPointer = 0;
bytePointer = 0;
-
+
for (int i = 0; i < height; i++) {
decodeNextScanline(buffer, lineOffset, startX);
lineOffset += scanlineStride;
@@ -595,16 +595,16 @@
// White run
current = nextNBits(10);
entry = white[current];
-
+
// Get the 3 fields from the entry
isT = entry & 0x0001;
bits = (entry >>> 1) & 0x0f;
-
+
if (bits == 12) { // Additional Make up code
// Get the next 2 bits
twoBits = nextLesserThan8Bits(2);
// Consolidate the 2 new bits and last 2 bits into 4 bits
- current = ((current << 2) & 0x000c) | twoBits;
+ current = ((current << 2) & 0x000c) | twoBits;
entry = additionalMakeup[current];
bits = (entry >>> 1) & 0x07; // 3 bits 0000 0111
code = (entry >>> 4) & 0x0fff; // 12 bits
@@ -617,7 +617,7 @@
throw new Error("TIFFFaxDecoder1");
} else {
// 11 bits - 0000 0111 1111 1111 = 0x07ff
- code = (entry >>> 5) & 0x07ff;
+ code = (entry >>> 5) & 0x07ff;
bitOffset += code;
updatePointer(10 - bits);
@@ -628,20 +628,20 @@
}
}
- // Check whether this run completed one width, if so
+ // Check whether this run completed one width, if so
// advance to next byte boundary for compression = 2.
if (bitOffset == w) {
- if (compression == 2) {
+ if (compression == 2) {
advancePointer();
}
break;
}
- while (isWhite == false) {
+ while ( ! isWhite ) {
// Black run
current = nextLesserThan8Bits(4);
entry = initBlack[current];
-
+
// Get the 3 fields from the entry
isT = entry & 0x0001;
bits = (entry >>> 1) & 0x000f;
@@ -650,7 +650,7 @@
if (code == 100) {
current = nextNBits(9);
entry = black[current];
-
+
// Get the 3 fields from the entry
isT = entry & 0x0001;
bits = (entry >>> 1) & 0x000f;
@@ -720,7 +720,7 @@
// Two-dimensional decoding methods
public void decode2D(byte[] buffer,
- byte compData[],
+ byte[] compData,
int startX,
int height,
long tiffT4Options) {
@@ -737,13 +737,13 @@
int entry, code, bits;
boolean isWhite;
int currIndex = 0;
- int temp[];
-
+ int[] temp;
+
// fillBits - dealt with this in readEOL
// 1D/2D encoding - dealt with this in readEOL
// uncompressedMode - haven't dealt with this yet.
-
+
oneD = (int)(tiffT4Options & 0x01);
uncompressedMode = (int)((tiffT4Options & 0x02) >> 1);
@@ -767,15 +767,15 @@
// Every line must begin with an EOL followed by a bit which
// indicates whether the following scanline is 1D or 2D encoded.
if (readEOL() == 0) {
- // 2D encoded scanline follows
-
- // Initialize previous scanlines changing elements, and
+ // 2D encoded scanline follows
+
+ // Initialize previous scanlines changing elements, and
// initialize current scanline's changing elements array
temp = prevChangingElems;
prevChangingElems = currChangingElems;
currChangingElems = temp;
currIndex = 0;
-
+
// a0 has to be set just before the start of this scanline.
a0 = -1;
isWhite = true;
@@ -786,40 +786,40 @@
while (bitOffset < w) {
// Get the next changing element
getNextChangingElement(a0, isWhite, b);
-
+
b1 = b[0];
b2 = b[1];
-
+
// Get the next seven bits
entry = nextLesserThan8Bits(7);
-
+
// Run these through the 2DCodes table
entry = (int)(twoDCodes[entry] & 0xff);
-
+
// Get the code and the number of bits used up
code = (entry & 0x78) >>> 3;
bits = entry & 0x07;
-
+
if (code == 0) {
if (!isWhite) {
setToBlack(buffer, lineOffset, bitOffset,
b2 - bitOffset);
}
bitOffset = a0 = b2;
-
+
// Set pointer to consume the correct number of bits.
updatePointer(7 - bits);
} else if (code == 1) {
// Horizontal
updatePointer(7 - bits);
-
+
// identify the next 2 codes.
int number;
if (isWhite) {
number = decodeWhiteCodeWord();
bitOffset += number;
currChangingElems[currIndex++] = bitOffset;
-
+
number = decodeBlackCodeWord();
setToBlack(buffer, lineOffset, bitOffset, number);
bitOffset += number;
@@ -829,34 +829,34 @@
setToBlack(buffer, lineOffset, bitOffset, number);
bitOffset += number;
currChangingElems[currIndex++] = bitOffset;
-
+
number = decodeWhiteCodeWord();
bitOffset += number;
currChangingElems[currIndex++] = bitOffset;
}
-
+
a0 = bitOffset;
} else if (code <= 8) {
// Vertical
a1 = b1 + (code - 5);
-
+
currChangingElems[currIndex++] = a1;
-
+
// We write the current color till a1 - 1 pos,
// since a1 is where the next color starts
if (!isWhite) {
- setToBlack(buffer, lineOffset, bitOffset,
+ setToBlack(buffer, lineOffset, bitOffset,
a1 - bitOffset);
}
bitOffset = a0 = a1;
isWhite = !isWhite;
-
+
updatePointer(7 - bits);
} else {
throw new Error("TIFFFaxDecoder4");
}
}
-
+
// Add the changing element beyond the current scanline for the
// other color too
currChangingElems[currIndex++] = bitOffset;
@@ -887,14 +887,14 @@
int entry, code, bits;
boolean isWhite;
int currIndex;
- int temp[];
+ int[] temp;
// Return values from getNextChangingElement
int[] b = new int[2];
-
- // uncompressedMode - have written some code for this, but this
+
+ // uncompressedMode - have written some code for this, but this
// has not been tested due to lack of test images using this optional
-
+
uncompressedMode = (int)((tiffT6Options & 0x02) >> 1);
// Local cached reference
@@ -914,8 +914,8 @@
// a0 has to be set just before the start of the scanline.
a0 = -1;
isWhite = true;
-
- // Assign the changing elements of the previous scanline to
+
+ // Assign the changing elements of the previous scanline to
// prevChangingElems and start putting this new scanline's
// changing elements into the currChangingElems.
temp = prevChangingElems;
@@ -931,7 +931,7 @@
// Till one whole scanline is decoded
while (bitOffset < w) {
- // Get the next changing element
+ // Get the next changing element
getNextChangingElement(a0, isWhite, b);
b1 = b[0];
b2 = b[1];
@@ -944,11 +944,11 @@
// Get the code and the number of bits used up
code = (entry & 0x78) >>> 3;
bits = entry & 0x07;
-
+
if (code == 0) { // Pass
// We always assume WhiteIsZero format for fax.
if (!isWhite) {
- setToBlack(buffer, lineOffset, bitOffset,
+ setToBlack(buffer, lineOffset, bitOffset,
b2 - bitOffset);
}
bitOffset = a0 = b2;
@@ -958,7 +958,7 @@
} else if (code == 1) { // Horizontal
// Set pointer to only consume the correct number of bits.
updatePointer(7 - bits);
-
+
// identify the next 2 alternating color codes.
int number;
if (isWhite) {
@@ -982,7 +982,7 @@
bitOffset += number;
cce[currIndex++] = bitOffset;
}
-
+
a0 = bitOffset;
} else if (code <= 8) { // Vertical
a1 = b1 + (code - 5);
@@ -1010,24 +1010,24 @@
while (nextLesserThan8Bits(1) != 1) {
zeros++;
}
-
+
if (zeros > 5) {
// Exit code
-
+
// Zeros before exit code
zeros = zeros - 6;
if (!isWhite && (zeros > 0)) {
cce[currIndex++] = bitOffset;
}
-
+
// Zeros before the exit code
bitOffset += zeros;
if (zeros > 0) {
// Some zeros have been written
isWhite = true;
- }
-
+ }
+
// Read in the bit which specifies the color of
// the following run
if (nextLesserThan8Bits(1) == 0) {
@@ -1043,7 +1043,7 @@
}
exit = true;
- }
+ }
if (zeros == 5) {
if (!isWhite) {
@@ -1069,7 +1069,7 @@
throw new Error("TIFFFaxDecoder5");
}
}
-
+
// Add the changing element beyond the current scanline for the
// other color too
cce[currIndex++] = bitOffset;
@@ -1126,16 +1126,16 @@
while (isWhite) {
current = nextNBits(10);
entry = white[current];
-
+
// Get the 3 fields from the entry
isT = entry & 0x0001;
bits = (entry >>> 1) & 0x0f;
-
+
if (bits == 12) { // Additional Make up code
// Get the next 2 bits
twoBits = nextLesserThan8Bits(2);
// Consolidate the 2 new bits and last 2 bits into 4 bits
- current = ((current << 2) & 0x000c) | twoBits;
+ current = ((current << 2) & 0x000c) | twoBits;
entry = additionalMakeup[current];
bits = (entry >>> 1) & 0x07; // 3 bits 0000 0111
code = (entry >>> 4) & 0x0fff; // 12 bits
@@ -1147,7 +1147,7 @@
throw new Error("TIFFFaxDecoder1");
} else {
// 11 bits - 0000 0111 1111 1111 = 0x07ff
- code = (entry >>> 5) & 0x07ff;
+ code = (entry >>> 5) & 0x07ff;
runLength += code;
updatePointer(10 - bits);
if (isT == 0) {
@@ -1164,34 +1164,34 @@
int current, entry, bits, isT, code = -1;
int runLength = 0;
boolean isWhite = false;
-
+
while (!isWhite) {
current = nextLesserThan8Bits(4);
entry = initBlack[current];
-
+
// Get the 3 fields from the entry
isT = entry & 0x0001;
bits = (entry >>> 1) & 0x000f;
code = (entry >>> 5) & 0x07ff;
-
+
if (code == 100) {
current = nextNBits(9);
entry = black[current];
-
+
// Get the 3 fields from the entry
isT = entry & 0x0001;
bits = (entry >>> 1) & 0x000f;
code = (entry >>> 5) & 0x07ff;
-
+
if (bits == 12) {
- // Additional makeup codes
+ // Additional makeup codes
updatePointer(5);
current = nextLesserThan8Bits(4);
entry = additionalMakeup[current];
bits = (entry >>> 1) & 0x07; // 3 bits 0000 0111
code = (entry >>> 4) & 0x0fff; // 12 bits
runLength += code;
-
+
updatePointer(4 - bits);
} else if (bits == 15) {
// EOL code
@@ -1242,7 +1242,7 @@
// If the number of bitsLeft is less than 8, then to have a 12
// bit EOL sequence, two more bytes are certainly going to be
- // required. The first of them has to be all zeros, so ensure
+ // required. The first of them has to be all zeros, so ensure
// that.
if (bitsLeft < 4) {
if (nextNBits(8) != 0) {
@@ -1250,12 +1250,12 @@
}
}
- // There might be a random number of fill bytes with 0s, so
+ // There might be a random number of fill bytes with 0s, so
// loop till the EOL of 0000 0001 is found, as long as all
// the bytes preceding it are 0's.
int n;
while ((n = nextNBits(8)) != 1) {
-
+
// If not all zeros
if (n != 0) {
throw new Error("TIFFFaxDecoder8");
@@ -1263,13 +1263,13 @@
}
}
- // If one dimensional encoding mode, then always return 1
+ // If one dimensional encoding mode, then always return 1
if (oneD == 0) {
return 1;
} else {
// Otherwise for 2D encoding mode,
// The next one bit signifies 1D/2D encoding of next line.
- return nextLesserThan8Bits(1);
+ return nextLesserThan8Bits(1);
}
}
@@ -1307,10 +1307,10 @@
byte b, next, next2next;
int l = data.length - 1;
int bp = this.bytePointer;
-
+
if (fillOrder == 1) {
b = data[bp];
-
+
if (bp == l) {
next = 0x00;
next2next = 0x00;
@@ -1345,16 +1345,16 @@
bitsFromNext2NextByte = bitsFromNextByte - 8;
bitsFromNextByte = 8;
}
-
+
bytePointer++;
-
+
int i1 = (b & table1[bitsLeft]) << (bitsToGet - bitsLeft);
int i2 = (next & table2[bitsFromNextByte]) >>> (8 - bitsFromNextByte);
-
+
int i3 = 0;
if (bitsFromNext2NextByte != 0) {
i2 <<= bitsFromNext2NextByte;
- i3 = (next2next & table2[bitsFromNext2NextByte]) >>>
+ i3 = (next2next & table2[bitsFromNext2NextByte]) >>>
(8 - bitsFromNext2NextByte);
i2 |= i3;
bytePointer++;
@@ -1367,7 +1367,7 @@
bitPointer = bitsFromNextByte;
}
}
-
+
int i = i1 | i2;
return i;
}
@@ -1422,7 +1422,7 @@
// Move pointer backwards by given amount of bits
private void updatePointer(int bitsToMoveBack) {
int i = bitPointer - bitsToMoveBack;
-
+
if (i < 0) {
bytePointer--;
bitPointer = 8 + i;
@@ -1430,14 +1430,14 @@
bitPointer = i;
}
}
-
+
// Move to the next byte boundary
private boolean advancePointer() {
if (bitPointer != 0) {
bytePointer++;
bitPointer = 0;
}
-
+
return true;
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImage.java?view=diff&rev=478249&r1=478248&r2=478249
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImage.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImage.java Wed Nov 22 09:29:37 2006
@@ -747,9 +747,9 @@
}
int bandLength = colormap.length/3;
- byte r[] = new byte[bandLength];
- byte g[] = new byte[bandLength];
- byte b[] = new byte[bandLength];
+ byte[] r = new byte[bandLength];
+ byte[] g = new byte[bandLength];
+ byte[] b = new byte[bandLength];
int gIndex = bandLength;
int bIndex = bandLength * 2;
@@ -826,9 +826,9 @@
// Get the data array out of the DataBuffer
- byte bdata[] = null;
- short sdata[] = null;
- int idata[] = null;
+ byte[] bdata = null;
+ short[] sdata = null;
+ int[] idata = null;
SampleModel sampleModel = getSampleModel();
WritableRaster tile = makeTile(tileX,tileY);
@@ -874,7 +874,7 @@
int unitsInThisTile = newRect.width * newRect.height * numBands;
// Allocate read buffer if needed.
- byte data[] = compression != COMP_NONE || imageType == TYPE_PALETTE ?
+ byte[] data = compression != COMP_NONE || imageType == TYPE_PALETTE ?
new byte[byteCount] : null;
// Read the data, uncompressing as needed. There are four cases:
@@ -924,7 +924,7 @@
if (decodePaletteAsShorts) {
- short tempData[]= null;
+ short[] tempData= null;
// At this point the data is 1 banded and will
// become 3 banded only after we've done the palette
@@ -945,7 +945,7 @@
stream.readFully(data, 0, byteCount);
- byte byteArray[] = new byte[entries];
+ byte[] byteArray = new byte[entries];
decodePackbits(data, entries, byteArray);
tempData = new short[unitsBeforeLookup];
interpretBytesAsShorts(byteArray, tempData,
@@ -956,7 +956,7 @@
// Read in all the compressed data for this tile
stream.readFully(data, 0, byteCount);
- byte byteArray[] = new byte[entries];
+ byte[] byteArray = new byte[entries];
lzwDecoder.decode(data, byteArray, newRect.height);
tempData = new short[unitsBeforeLookup];
interpretBytesAsShorts(byteArray, tempData,
@@ -965,7 +965,7 @@
} else if (compression == COMP_DEFLATE) {
stream.readFully(data, 0, byteCount);
- byte byteArray[] = new byte[entries];
+ byte[] byteArray = new byte[entries];
inflate(data, byteArray);
tempData = new short[unitsBeforeLookup];
interpretBytesAsShorts(byteArray, tempData,
@@ -1048,7 +1048,7 @@
// decompression.
int bytesInThisTile = unitsInThisTile * 2;
- byte byteArray[] = new byte[bytesInThisTile];
+ byte[] byteArray = new byte[bytesInThisTile];
decodePackbits(data, bytesInThisTile, byteArray);
interpretBytesAsShorts(byteArray, sdata,
unitsInThisTile);
@@ -1062,7 +1062,7 @@
// need to multiply unitsInThisTile by 2 in order to
// figure out how many bytes we'll get after
// decompression.
- byte byteArray[] = new byte[unitsInThisTile * 2];
+ byte[] byteArray = new byte[unitsInThisTile * 2];
lzwDecoder.decode(data, byteArray, newRect.height);
interpretBytesAsShorts(byteArray, sdata,
unitsInThisTile);
@@ -1070,7 +1070,7 @@
} else if (compression == COMP_DEFLATE) {
stream.readFully(data, 0, byteCount);
- byte byteArray[] = new byte[unitsInThisTile * 2];
+ byte[] byteArray = new byte[unitsInThisTile * 2];
inflate(data, byteArray);
interpretBytesAsShorts(byteArray, sdata,
unitsInThisTile);
@@ -1091,7 +1091,7 @@
if (decodePaletteAsShorts) {
- byte tempData[]= null;
+ byte[] tempData= null;
// At this point the data is 1 banded and will
// become 3 banded only after we've done the palette
@@ -1221,7 +1221,7 @@
// Output short images
if (decodePaletteAsShorts) {
- byte tempData[] = null;
+ byte[] tempData = null;
try {
stream.readFully(data, 0, byteCount);
@@ -1401,7 +1401,7 @@
// need to multiply unitsInThisTile by 2 in order to
// figure out how many bytes we'll get after
// decompression.
- byte byteArray[] = new byte[unitsInThisTile * 2];
+ byte[] byteArray = new byte[unitsInThisTile * 2];
lzwDecoder.decode(data, byteArray, newRect.height);
interpretBytesAsShorts(byteArray, sdata,
unitsInThisTile);
@@ -1417,14 +1417,14 @@
// decompression.
int bytesInThisTile = unitsInThisTile * 2;
- byte byteArray[] = new byte[bytesInThisTile];
+ byte[] byteArray = new byte[bytesInThisTile];
decodePackbits(data, bytesInThisTile, byteArray);
interpretBytesAsShorts(byteArray, sdata,
unitsInThisTile);
} else if (compression == COMP_DEFLATE) {
stream.readFully(data, 0, byteCount);
- byte byteArray[] = new byte[unitsInThisTile * 2];
+ byte[] byteArray = new byte[unitsInThisTile * 2];
inflate(data, byteArray);
interpretBytesAsShorts(byteArray, sdata,
unitsInThisTile);
@@ -1445,7 +1445,7 @@
// need to multiply unitsInThisTile by 4 in order to
// figure out how many bytes we'll get after
// decompression.
- byte byteArray[] = new byte[unitsInThisTile * 4];
+ byte[] byteArray = new byte[unitsInThisTile * 4];
lzwDecoder.decode(data, byteArray, newRect.height);
interpretBytesAsInts(byteArray, idata,
unitsInThisTile);
@@ -1461,14 +1461,14 @@
// decompression.
int bytesInThisTile = unitsInThisTile * 4;
- byte byteArray[] = new byte[bytesInThisTile];
+ byte[] byteArray = new byte[bytesInThisTile];
decodePackbits(data, bytesInThisTile, byteArray);
interpretBytesAsInts(byteArray, idata,
unitsInThisTile);
} else if (compression == COMP_DEFLATE) {
stream.readFully(data, 0, byteCount);
- byte byteArray[] = new byte[unitsInThisTile * 4];
+ byte[] byteArray = new byte[unitsInThisTile * 4];
inflate(data, byteArray);
interpretBytesAsInts(byteArray, idata,
unitsInThisTile);
@@ -1629,12 +1629,12 @@
return tile;
}
- private void readShorts(int shortCount, short shortArray[]) {
+ private void readShorts(int shortCount, short[] shortArray) {
// Since each short consists of 2 bytes, we need a
// byte array of double size
int byteCount = 2 * shortCount;
- byte byteArray[] = new byte[byteCount];
+ byte[] byteArray = new byte[byteCount];
try {
stream.readFully(byteArray, 0, byteCount);
@@ -1645,12 +1645,12 @@
interpretBytesAsShorts(byteArray, shortArray, shortCount);
}
- private void readInts(int intCount, int intArray[]) {
+ private void readInts(int intCount, int[] intArray) {
// Since each int consists of 4 bytes, we need a
// byte array of quadruple size
int byteCount = 4 * intCount;
- byte byteArray[] = new byte[byteCount];
+ byte[] byteArray = new byte[byteCount];
try {
stream.readFully(byteArray, 0, byteCount);
@@ -1663,8 +1663,8 @@
// Method to interpret a byte array to a short array, depending on
// whether the bytes are stored in a big endian or little endian format.
- private void interpretBytesAsShorts(byte byteArray[],
- short shortArray[],
+ private void interpretBytesAsShorts(byte[] byteArray,
+ short[] shortArray,
int shortCount) {
int j = 0;
@@ -1690,8 +1690,8 @@
// Method to interpret a byte array to a int array, depending on
// whether the bytes are stored in a big endian or little endian format.
- private void interpretBytesAsInts(byte byteArray[],
- int intArray[],
+ private void interpretBytesAsInts(byte[] byteArray,
+ int[] intArray,
int intCount) {
int j = 0;
@@ -1717,7 +1717,7 @@
}
// Uncompress packbits compressed image data.
- private byte[] decodePackbits(byte data[], int arraySize, byte[] dst) {
+ private byte[] decodePackbits(byte[] data, int arraySize, byte[] dst) {
if (dst == null) {
dst = new byte[arraySize];
@@ -1766,7 +1766,7 @@
boolean isAlphaPremultiplied, int transparency) {
ComponentColorModel ccm = null;
- int RGBBits[] = null;
+ int[] RGBBits = null;
ColorSpace cs = null;
switch(numBands) {
case 2: // gray+alpha
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java?view=diff&rev=478249&r1=478248&r2=478249
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFImageEncoder.java Wed Nov 22 09:29:37 2006
@@ -151,7 +151,7 @@
SampleModel sampleModel = im.getSampleModel();
// Retrieve and verify sample size.
- int sampleSize[] = sampleModel.getSampleSize();
+ int[] sampleSize = sampleModel.getSampleSize();
for(int i = 1; i < sampleSize.length; i++) {
if(sampleSize[i] != sampleSize[0]) {
throw new Error("TIFFImageEncoder0");
@@ -202,7 +202,7 @@
}
IndexColorModel icm = null;
int sizeOfColormap = 0;
- char colormap[] = null;
+ char[] colormap = null;
// Set image type.
int imageType = TIFF_UNSUPPORTED;
@@ -219,11 +219,11 @@
"TIFFImageEncoder7");
}
- byte r[] = new byte[mapSize];
+ byte[] r = new byte[mapSize];
icm.getReds(r);
- byte g[] = new byte[mapSize];
+ byte[] g = new byte[mapSize];
icm.getGreens(g);
- byte b[] = new byte[mapSize];
+ byte[] b = new byte[mapSize];
icm.getBlues(b);
if ((r[0] & 0xff) == 0 &&
@@ -344,11 +344,11 @@
icm = (IndexColorModel)colorModel;
sizeOfColormap = icm.getMapSize();
- byte r[] = new byte[sizeOfColormap];
+ byte[] r = new byte[sizeOfColormap];
icm.getReds(r);
- byte g[] = new byte[sizeOfColormap];
+ byte[] g = new byte[sizeOfColormap];
icm.getGreens(g);
- byte b[] = new byte[sizeOfColormap];
+ byte[] b = new byte[sizeOfColormap];
icm.getBlues(b);
int redIndex = 0, greenIndex = sizeOfColormap;
@@ -446,7 +446,7 @@
numTiles = (int)Math.ceil((double)height/(double)tileHeight);
}
- long tileByteCounts[] = new long[numTiles];
+ long[] tileByteCounts = new long[numTiles];
long bytesPerRow =
(long)Math.ceil((sampleSize[0] / 8.0) * tileWidth * numBands);
@@ -468,7 +468,7 @@
// The data will be written after the IFD: create the array here
// but fill it in later.
- long tileOffsets[] = new long[numTiles];
+ long[] tileOffsets = new long[numTiles];
// Basic fields - have to be in increasing numerical order.
// ImageWidth 256
@@ -1475,7 +1475,7 @@
// unsigned 8 bits
case TIFFField.TIFF_BYTE:
- byte bytes[] = field.getAsBytes();
+ byte[] bytes = field.getAsBytes();
if (count > 4) count =4;
for (int i=0; i<count; i++)
output.write(bytes[i]);
@@ -1486,7 +1486,7 @@
// unsigned 16 bits
case TIFFField.TIFF_SHORT:
- char chars[] = field.getAsChars();
+ char[] chars = field.getAsChars();
if (count > 2) count=2;
for (int i=0; i<count; i++)
writeUnsignedShort(chars[i]);
@@ -1497,7 +1497,7 @@
// unsigned 32 bits
case TIFFField.TIFF_LONG:
- long longs[] = field.getAsLongs();
+ long[] longs = field.getAsLongs();
for (int i=0; i<count; i++) {
writeLong(longs[i]);
@@ -1518,7 +1518,7 @@
case TIFFField.TIFF_BYTE:
case TIFFField.TIFF_SBYTE:
case TIFFField.TIFF_UNDEFINED:
- byte bytes[] = field.getAsBytes();
+ byte[] bytes = field.getAsBytes();
for (int i=0; i<count; i++) {
output.write(bytes[i]);
}
@@ -1526,13 +1526,13 @@
// unsigned 16 bits
case TIFFField.TIFF_SHORT:
- char chars[] = field.getAsChars();
+ char[] chars = field.getAsChars();
for (int i=0; i<count; i++) {
writeUnsignedShort(chars[i]);
}
break;
case TIFFField.TIFF_SSHORT:
- short shorts[] = field.getAsShorts();
+ short[] shorts = field.getAsShorts();
for (int i=0; i<count; i++) {
writeUnsignedShort(shorts[i]);
}
@@ -1541,7 +1541,7 @@
// unsigned 32 bits
case TIFFField.TIFF_LONG:
case TIFFField.TIFF_SLONG:
- long longs[] = field.getAsLongs();
+ long[] longs = field.getAsLongs();
for (int i=0; i<count; i++) {
writeLong(longs[i]);
}
@@ -1560,13 +1560,13 @@
for (int i=0; i<count; i++) {
long longBits = Double.doubleToLongBits(doubles[i]);
writeLong(longBits >>> 32);
- writeLong(longBits & 0xffffffff);
+ writeLong(longBits & 0xffffffff); // todo looks very suspect !!
}
break;
case TIFFField.TIFF_RATIONAL:
case TIFFField.TIFF_SRATIONAL:
- long rationals[][] = field.getAsRationals();
+ long[][] rationals = field.getAsRationals();
for (int i=0; i<count; i++) {
writeLong(rationals[i][0]);
writeLong(rationals[i][1]);
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFLZWDecoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFLZWDecoder.java?view=diff&rev=478249&r1=478248&r2=478249
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFLZWDecoder.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/tiff/TIFFLZWDecoder.java Wed Nov 22 09:29:37 2006
@@ -26,8 +26,9 @@
*/
public class TIFFLZWDecoder {
- byte stringTable[][];
- byte data[] = null, uncompData[];
+ byte[][] stringTable;
+ byte[] data = null;
+ byte[] uncompData;
int tableIndex, bitsToGet = 9;
int bytePointer, bitPointer;
int dstIndex;
@@ -36,13 +37,13 @@
int nextData = 0;
int nextBits = 0;
- int andTable[] = {
- 511,
+ int[] andTable = {
+ 511,
1023,
2047,
4095
};
-
+
public TIFFLZWDecoder(int w, int predictor, int samplesPerPixel) {
this.w = w;
this.predictor = predictor;
@@ -56,7 +57,7 @@
* @param uncompData Array to return the uncompressed data in.
* @param h The number of rows the compressed data contains.
*/
- public byte[] decode(byte data[], byte uncompData[], int h) {
+ public byte[] decode(byte[] data, byte[] uncompData, int h) {
if(data[0] == (byte)0x00 && data[1] == (byte)0x01) {
throw new UnsupportedOperationException("TIFFLZWDecoder0");
@@ -67,7 +68,7 @@
this.data = data;
this.h = h;
this.uncompData = uncompData;
-
+
// Initialize pointers
bytePointer = 0;
bitPointer = 0;
@@ -78,9 +79,9 @@
nextBits = 0;
int code, oldCode = 0;
- byte string[];
-
- while ( ((code = getNextCode()) != 257) &&
+ byte[] string;
+
+ while ( ((code = getNextCode()) != 257) &&
dstIndex != uncompData.length) {
if (code == 256) {
@@ -102,7 +103,7 @@
string = stringTable[code];
writeString(string);
- addStringToTable(stringTable[oldCode], string[0]);
+ addStringToTable(stringTable[oldCode], string[0]);
oldCode = code;
} else {
@@ -123,11 +124,11 @@
int count;
for (int j = 0; j < h; j++) {
-
+
count = samplesPerPixel * (j * w + 1);
-
+
for (int i = samplesPerPixel; i < w * samplesPerPixel; i++) {
-
+
uncompData[count] += uncompData[count - samplesPerPixel];
count++;
}
@@ -144,12 +145,12 @@
public void initializeStringTable() {
stringTable = new byte[4096][];
-
+
for (int i=0; i<256; i++) {
stringTable[i] = new byte[1];
stringTable[i][0] = (byte)i;
}
-
+
tableIndex = 258;
bitsToGet = 9;
}
@@ -157,57 +158,57 @@
/**
* Write out the string just uncompressed.
*/
- public void writeString(byte string[]) {
-
+ public void writeString(byte[] string) {
+
for (int i=0; i<string.length; i++) {
uncompData[dstIndex++] = string[i];
}
}
-
+
/**
* Add a new string to the string table.
*/
- public void addStringToTable(byte oldString[], byte newString) {
+ public void addStringToTable(byte[] oldString, byte newString) {
int length = oldString.length;
- byte string[] = new byte[length + 1];
+ byte[] string = new byte[length + 1];
System.arraycopy(oldString, 0, string, 0, length);
string[length] = newString;
-
+
// Add this new String to the table
stringTable[tableIndex++] = string;
-
+
if (tableIndex == 511) {
bitsToGet = 10;
} else if (tableIndex == 1023) {
bitsToGet = 11;
} else if (tableIndex == 2047) {
bitsToGet = 12;
- }
+ }
}
/**
* Add a new string to the string table.
*/
- public void addStringToTable(byte string[]) {
-
+ public void addStringToTable(byte[] string) {
+
// Add this new String to the table
stringTable[tableIndex++] = string;
-
+
if (tableIndex == 511) {
bitsToGet = 10;
} else if (tableIndex == 1023) {
bitsToGet = 11;
} else if (tableIndex == 2047) {
bitsToGet = 12;
- }
+ }
}
/**
* Append <code>newString</code> to the end of <code>oldString</code>.
*/
- public byte[] composeString(byte oldString[], byte newString) {
+ public byte[] composeString(byte[] oldString, byte newString) {
int length = oldString.length;
- byte string[] = new byte[length + 1];
+ byte[] string = new byte[length + 1];
System.arraycopy(oldString, 0, string, 0, length);
string[length] = newString;
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/ForwardSeekableStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/ForwardSeekableStream.java?view=diff&rev=478249&r1=478248&r2=478249
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/ForwardSeekableStream.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/ForwardSeekableStream.java Wed Nov 22 09:29:37 2006
@@ -38,7 +38,7 @@
/** The marked position. */
long markPos = -1L;
- /**
+ /**
* Constructs a <code>InputStreamForwardSeekableStream</code> from a
* regular <code>InputStream</code>.
*/
@@ -82,13 +82,13 @@
}
/** Forwards the request to the real <code>InputStream</code>. */
- public synchronized final void mark(int readLimit) {
+ public final synchronized void mark(int readLimit) {
markPos = pointer;
src.mark(readLimit);
}
/** Forwards the request to the real <code>InputStream</code>. */
- public synchronized final void reset() throws IOException {
+ public final synchronized void reset() throws IOException {
if (markPos != -1) {
pointer = markPos;
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/ImageEncoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/ImageEncoder.java?view=diff&rev=478249&r1=478248&r2=478249
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/ImageEncoder.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/ImageEncoder.java Wed Nov 22 09:29:37 2006
@@ -40,30 +40,30 @@
* the ImageEncodeParam interface. For example, a JPEGImageEncoder
* will return an instance of JPEGEncodeParam.
*/
- public ImageEncodeParam getParam();
+ ImageEncodeParam getParam();
/**
- * Sets the current parameters to an instance of the
+ * Sets the current parameters to an instance of the
* ImageEncodeParam interface. Concrete implementations
* of ImageEncoder may throw a RuntimeException if the
* params argument is not an instance of the appropriate
* subclass or subinterface. For example, a JPEGImageEncoder
* will expect param to be an instance of JPEGEncodeParam.
*/
- public void setParam(ImageEncodeParam param);
+ void setParam(ImageEncodeParam param);
/** Returns the OutputStream associated with this ImageEncoder. */
- public OutputStream getOutputStream();
-
+ OutputStream getOutputStream();
+
/**
* Encodes a Raster with a given ColorModel and writes the output
* to the OutputStream associated with this ImageEncoder.
*/
- public void encode(Raster ras, ColorModel cm) throws IOException;
+ void encode(Raster ras, ColorModel cm) throws IOException;
/**
* Encodes a RenderedImage and writes the output to the
* OutputStream associated with this ImageEncoder.
*/
- public void encode(RenderedImage im) throws IOException;
+ void encode(RenderedImage im) throws IOException;
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/PropertyUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/PropertyUtil.java?view=diff&rev=478249&r1=478248&r2=478249
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/PropertyUtil.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/PropertyUtil.java Wed Nov 22 09:29:37 2006
@@ -23,7 +23,7 @@
import org.apache.batik.i18n.LocalizableSupport;
public class PropertyUtil {
- protected final static String RESOURCES =
+ protected static final String RESOURCES =
"org.apache.batik.bridge.resources.properties";
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/SeekableOutputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/SeekableOutputStream.java?view=diff&rev=478249&r1=478248&r2=478249
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/SeekableOutputStream.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/codec/util/SeekableOutputStream.java Wed Nov 22 09:29:37 2006
@@ -25,6 +25,8 @@
/**
* An <code>OutputStream</code> which can seek to an arbitrary offset.
+ *
+ * @version $Id$
*/
public class SeekableOutputStream extends OutputStream {
@@ -52,11 +54,11 @@
file.write(b);
}
- public void write(byte b[]) throws IOException {
+ public void write(byte[] b) throws IOException {
file.write(b);
}
- public void write(byte b[], int off, int len) throws IOException {
+ public void write(byte[] b, int off, int len) throws IOException {
file.write(b, off, len);
}