com.lowagie.text.pdf.codec

Class CCITTG4Encoder

public class CCITTG4Encoder extends Object

Encodes data in the CCITT G4 FAX format.
Field Summary
intbit
static intCODE
intdata
byte[]dataBp
static intEOL
static intG3CODE_EOF
static intG3CODE_EOL
static intG3CODE_INCOMP
static intG3CODE_INVALID
int[]horizcode
static intLENGTH
int[]msbmask
intoffsetData
static byte[]oneruns
ByteBufferoutBuf
int[]passcode
byte[]refline
introwbytes
introwpixels
static intRUNLEN
intsizeData
int[][]TIFFFaxBlackCodes
int[][]TIFFFaxWhiteCodes
int[][]vcodes
static byte[]zeroruns
Constructor Summary
CCITTG4Encoder(int width)
Creates a new encoder.
Method Summary
byte[]close()
Closes the encoder and returns the encoded data.
static byte[]compress(byte[] data, int width, int height)
Encodes a full image.
voidfax4Encode(byte[] data, int offset, int size)
Encodes a number of lines.
voidfax4Encode(byte[] data, int height)
Encodes a number of lines.
static intfind0span(byte[] bp, int offset, int bs, int be)
static intfind1span(byte[] bp, int offset, int bs, int be)
static intfinddiff(byte[] bp, int offset, int bs, int be, int color)
static intfinddiff2(byte[] bp, int offset, int bs, int be, int color)
voidFax3Encode2DRow()
voidFax4PostEncode()
intpixel(byte[] data, int offset, int bit)
voidputBits(int bits, int length)
voidputcode(int[] table)
voidputspan(int span, int[][] tab)

Field Detail

bit

private int bit

CODE

private static final int CODE

data

private int data

dataBp

private byte[] dataBp

EOL

private static final int EOL

G3CODE_EOF

private static final int G3CODE_EOF

G3CODE_EOL

private static final int G3CODE_EOL

G3CODE_INCOMP

private static final int G3CODE_INCOMP

G3CODE_INVALID

private static final int G3CODE_INVALID

horizcode

private int[] horizcode

LENGTH

private static final int LENGTH

msbmask

private int[] msbmask

offsetData

private int offsetData

oneruns

private static byte[] oneruns

outBuf

private ByteBuffer outBuf

passcode

private int[] passcode

refline

private byte[] refline

rowbytes

private int rowbytes

rowpixels

private int rowpixels

RUNLEN

private static final int RUNLEN

sizeData

private int sizeData

TIFFFaxBlackCodes

private int[][] TIFFFaxBlackCodes

TIFFFaxWhiteCodes

private int[][] TIFFFaxWhiteCodes

vcodes

private int[][] vcodes

zeroruns

private static byte[] zeroruns

Constructor Detail

CCITTG4Encoder

public CCITTG4Encoder(int width)
Creates a new encoder.

Parameters: width the line width

Method Detail

close

public byte[] close()
Closes the encoder and returns the encoded data.

Returns: the encoded data

compress

public static byte[] compress(byte[] data, int width, int height)
Encodes a full image.

Parameters: data the data to encode width the image width height the image height

Returns: the encoded image

fax4Encode

public void fax4Encode(byte[] data, int offset, int size)
Encodes a number of lines.

Parameters: data the data to be encoded offset the offset into the data size the size of the data to be encoded

fax4Encode

public void fax4Encode(byte[] data, int height)
Encodes a number of lines.

Parameters: data the data to be encoded height the number of lines to encode

find0span

private static int find0span(byte[] bp, int offset, int bs, int be)

find1span

private static int find1span(byte[] bp, int offset, int bs, int be)

finddiff

private static int finddiff(byte[] bp, int offset, int bs, int be, int color)

finddiff2

private static int finddiff2(byte[] bp, int offset, int bs, int be, int color)

Fax3Encode2DRow

private void Fax3Encode2DRow()

Fax4PostEncode

private void Fax4PostEncode()

pixel

private int pixel(byte[] data, int offset, int bit)

putBits

private void putBits(int bits, int length)

putcode

private void putcode(int[] table)

putspan

private void putspan(int span, int[][] tab)