public class G31DEncoder extends java.lang.Object implements ImageEncoder
Modifier and Type | Field and Description |
---|---|
protected int |
currPos |
protected int |
scanLineWidth |
Constructor and Description |
---|
G31DEncoder(java.io.OutputStream os,
int scanLineWidth,
int buf_length,
Updatable<java.lang.Integer> writer) |
Modifier and Type | Method and Description |
---|---|
void |
encode(byte[] pixels,
int start,
int len)
This method assumes "len" is a multiplication of scan line length.
|
protected int |
encode1DLine(byte[] pixels,
int start) |
void |
finish() |
int |
getCompressedDataLen() |
void |
initialize() |
protected void |
outputRunLengthCode(int len,
int color) |
protected void |
outputRunLengthCode2(int len,
int color) |
protected void |
send_code_to_buffer(int code,
int codeLen) |
protected void |
setExtraFlush(boolean extraFlush) |
public G31DEncoder(java.io.OutputStream os, int scanLineWidth, int buf_length, Updatable<java.lang.Integer> writer)
public void encode(byte[] pixels, int start, int len) throws java.lang.Exception
encode
in interface ImageEncoder
len
- the number of pixels to be encodedpixels
- array of pixels (This has nothing to do with the actual bits per pixel since it could be pixel packed)start
- offset in the pixel array where the encoding starts (the actual position could be anywhere inside the
offset byte which maybe kept track of by the implementation class through a parameter such as
currPos if the encoder is pixel oriented).java.lang.Exception
protected int encode1DLine(byte[] pixels, int start) throws java.lang.Exception
java.lang.Exception
protected void outputRunLengthCode(int len, int color) throws java.lang.Exception
java.lang.Exception
protected void outputRunLengthCode2(int len, int color) throws java.lang.Exception
java.lang.Exception
public void finish() throws java.lang.Exception
finish
in interface ImageEncoder
java.lang.Exception
public int getCompressedDataLen()
getCompressedDataLen
in interface ImageEncoder
public void initialize() throws java.lang.Exception
initialize
in interface ImageEncoder
java.lang.Exception
protected void send_code_to_buffer(int code, int codeLen) throws java.lang.Exception
java.lang.Exception
protected void setExtraFlush(boolean extraFlush)