public class CCITTG4Encoder extends Object
Modifier and Type | Field and Description |
---|---|
private int |
bit |
private static int |
CODE |
private int |
data |
private byte[] |
dataBp |
private static int |
EOL |
private static int |
G3CODE_EOF |
private static int |
G3CODE_EOL |
private static int |
G3CODE_INCOMP |
private static int |
G3CODE_INVALID |
private int[] |
horizcode |
private static int |
LENGTH |
private int[] |
msbmask |
private int |
offsetData |
private static byte[] |
oneruns |
private ByteBuffer |
outBuf |
private int[] |
passcode |
private byte[] |
refline |
private int |
rowbytes |
private int |
rowpixels |
private static int |
RUNLEN |
private int |
sizeData |
private int[][] |
TIFFFaxBlackCodes |
private int[][] |
TIFFFaxWhiteCodes |
private int[][] |
vcodes |
private static byte[] |
zeroruns |
Constructor and Description |
---|
CCITTG4Encoder(int width)
Creates a new encoder.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
close()
Closes the encoder and returns the encoded data.
|
static byte[] |
compress(byte[] data,
int width,
int height)
Encodes a full image.
|
private void |
Fax3Encode2DRow() |
void |
fax4Encode(byte[] data,
int height)
Encodes a number of lines.
|
void |
fax4Encode(byte[] data,
int offset,
int size)
Encodes a number of lines.
|
private void |
Fax4PostEncode() |
private static int |
find0span(byte[] bp,
int offset,
int bs,
int be) |
private static int |
find1span(byte[] bp,
int offset,
int bs,
int be) |
private static int |
finddiff(byte[] bp,
int offset,
int bs,
int be,
int color) |
private static int |
finddiff2(byte[] bp,
int offset,
int bs,
int be,
int color) |
private int |
pixel(byte[] data,
int offset,
int bit) |
private void |
putBits(int bits,
int length) |
private void |
putcode(int[] table) |
private void |
putspan(int span,
int[][] tab) |
private int rowbytes
private int rowpixels
private int bit
private int data
private byte[] refline
private ByteBuffer outBuf
private byte[] dataBp
private int offsetData
private int sizeData
private static byte[] zeroruns
private static byte[] oneruns
private static final int LENGTH
private static final int CODE
private static final int RUNLEN
private static final int EOL
private static final int G3CODE_EOL
private static final int G3CODE_INVALID
private static final int G3CODE_EOF
private static final int G3CODE_INCOMP
private int[][] TIFFFaxWhiteCodes
private int[][] TIFFFaxBlackCodes
private int[] horizcode
private int[] passcode
private int[][] vcodes
private int[] msbmask
public CCITTG4Encoder(int width)
width
- the line widthpublic void fax4Encode(byte[] data, int offset, int size)
data
- the data to be encodedoffset
- the offset into the datasize
- the size of the data to be encodedpublic static byte[] compress(byte[] data, int width, int height)
data
- the data to encodewidth
- the image widthheight
- the image heightpublic void fax4Encode(byte[] data, int height)
data
- the data to be encodedheight
- the number of lines to encodeprivate void putcode(int[] table)
private void putspan(int span, int[][] tab)
private void putBits(int bits, int length)
private void Fax3Encode2DRow()
private void Fax4PostEncode()
public byte[] close()
private int pixel(byte[] data, int offset, int bit)
private static int find1span(byte[] bp, int offset, int bs, int be)
private static int find0span(byte[] bp, int offset, int bs, int be)
private static int finddiff(byte[] bp, int offset, int bs, int be, int color)
private static int finddiff2(byte[] bp, int offset, int bs, int be, int color)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses