com.lizardtech.djvu
Class JB2Decode

java.lang.Object
  extended by com.lizardtech.djvu.DjVuObject
      extended by com.lizardtech.djvu.JB2Codec
          extended by com.lizardtech.djvu.JB2Decode
All Implemented Interfaces:
DjVuInterface

public class JB2Decode
extends JB2Codec

DOCUMENT ME!

Version:
$Revision: 1.5 $
Author:
$author$

Field Summary
protected  BitContext zpBitHolder
          DOCUMENT ME!
 
Fields inherited from class com.lizardtech.djvu.JB2Codec
abs_loc_x, abs_loc_y, abs_size_x, abs_size_y, BIGNEGATIVE, BIGPOSITIVE, bitcells, bitdist, cbitdist, dist_comment_byte, dist_comment_length, dist_match_index, dist_record_type, dist_refinement_flag, END_OF_DATA, gotstartrecordp, image_columns, image_rows, image_size_dist, inherited_shape_count_dist, last_bottom, last_left, last_right, last_row_bottom, last_row_left, leftcell, lib2shape, libinfo, MATCHED_COPY, MATCHED_REFINE, MATCHED_REFINE_IMAGE_ONLY, MATCHED_REFINE_LIBRARY_ONLY, MINUS_ONE_OBJECT, NEW_MARK, NEW_MARK_IMAGE_ONLY, NEW_MARK_LIBRARY_ONLY, NON_MARK_DATA, offset_type_dist, PRESERVED_COMMENT, refinementp, rel_loc_x_current, rel_loc_x_last, rel_loc_y_current, rel_loc_y_last, rel_size_x, rel_size_y, REQUIRED_DICT_OR_RESET, rightcell, shape2lib, short_list, short_list_pos, START_OF_DATA
 
Fields inherited from class com.lizardtech.djvu.DjVuObject
hasReferences
 
Constructor Summary
JB2Decode()
          Creates a new JB2Decode object.
 
Method Summary
protected  void code_absolute_location(com.lizardtech.djvu.JB2Blit jblt, int rows, int columns)
          DOCUMENT ME!
protected  void code_absolute_mark_size(GBitmap bm, int border)
          DOCUMENT ME!
protected  void code_bitmap_by_cross_coding(GBitmap bm, GBitmap cbm, int xd2c, int dw, int dy, int cy, int up1, int up0, int xup1, int xup0, int xdn1)
          DOCUMENT ME!
protected  void code_bitmap_directly(GBitmap bm, int dw, int dy, int up2, int up1, int up0)
          DOCUMENT ME!
protected  java.lang.String code_comment(java.lang.String comment)
          DOCUMENT ME!
protected  void code_image_size(JB2Dict jim)
          DOCUMENT ME!
protected  void code_image_size(JB2Image jim)
          DOCUMENT ME!
protected  void code_inherited_shape_count(JB2Dict jim)
          DOCUMENT ME!
protected  int code_match_index(int index, JB2Dict ignored)
          DOCUMENT ME!
protected  int code_record_type(int ignored)
          DOCUMENT ME!
protected  void code_relative_mark_size(GBitmap bm, int cw, int ch, int border)
          DOCUMENT ME!
 void code(JB2Dict jim)
          DOCUMENT ME!
 void code(JB2Image jim)
          DOCUMENT ME!
protected  boolean codeBit(boolean ignored, BitContext ctx)
          DOCUMENT ME!
protected  int codeBit(boolean ignored, byte[] array, int offset)
          DOCUMENT ME!
protected  int codeNum(int low, int high, NumContext ctx)
          DOCUMENT ME!
static JB2Decode createJB2Decode(DjVuInterface ref)
          Creates an instance of JB2Decode with the options interherited from the specified reference.
protected  int get_diff(int ignored, NumContext rel_loc)
          DOCUMENT ME!
 void init(java.io.InputStream gbs, JB2Dict zdict)
          DOCUMENT ME!
 
Methods inherited from class com.lizardtech.djvu.JB2Codec
add_library, code_absolute_mark_size, code_bitmap_by_cross_coding, code_bitmap_directly, code_eventual_lossless_refinement, code_record_A, code_record_B, code_relative_location, code_relative_mark_size, codeNum, fill_short_list, get_cross_context, get_direct_context, init_library, reset_numcoder, shape2lib, shift_cross_context, shift_direct_context, update_short_list
 
Methods inherited from class com.lizardtech.djvu.DjVuObject
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, setDjVuOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zpBitHolder

protected final BitContext zpBitHolder
DOCUMENT ME!

Constructor Detail

JB2Decode

public JB2Decode()
Creates a new JB2Decode object.

Method Detail

createJB2Decode

public static JB2Decode createJB2Decode(DjVuInterface ref)
Creates an instance of JB2Decode with the options interherited from the specified reference.

Parameters:
ref - Object to interherit DjVuOptions from.
Returns:
a new instance of JB2Decode.

code

public void code(JB2Image jim)
          throws java.io.IOException
DOCUMENT ME!

Parameters:
jim - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.IllegalStateException - DOCUMENT ME!

code

public void code(JB2Dict jim)
          throws java.io.IOException
DOCUMENT ME!

Parameters:
jim - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.IllegalStateException - DOCUMENT ME!

init

public void init(java.io.InputStream gbs,
                 JB2Dict zdict)
          throws java.io.IOException
DOCUMENT ME!

Parameters:
gbs - DOCUMENT ME!
zdict - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

codeBit

protected final boolean codeBit(boolean ignored,
                                BitContext ctx)
                         throws java.io.IOException
DOCUMENT ME!

Specified by:
codeBit in class JB2Codec
Parameters:
ignored - DOCUMENT ME!
ctx - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

codeBit

protected final int codeBit(boolean ignored,
                            byte[] array,
                            int offset)
                     throws java.io.IOException
DOCUMENT ME!

Specified by:
codeBit in class JB2Codec
Parameters:
ignored - DOCUMENT ME!
array - DOCUMENT ME!
offset - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

codeNum

protected int codeNum(int low,
                      int high,
                      NumContext ctx)
               throws java.io.IOException
DOCUMENT ME!

Parameters:
low - DOCUMENT ME!
high - DOCUMENT ME!
ctx - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

code_absolute_location

protected void code_absolute_location(com.lizardtech.djvu.JB2Blit jblt,
                                      int rows,
                                      int columns)
                               throws java.io.IOException
DOCUMENT ME!

Specified by:
code_absolute_location in class JB2Codec
Parameters:
jblt - DOCUMENT ME!
rows - DOCUMENT ME!
columns - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.IllegalStateException - DOCUMENT ME!

code_absolute_mark_size

protected void code_absolute_mark_size(GBitmap bm,
                                       int border)
                                throws java.io.IOException
DOCUMENT ME!

Specified by:
code_absolute_mark_size in class JB2Codec
Parameters:
bm - DOCUMENT ME!
border - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.IllegalStateException - DOCUMENT ME!

code_bitmap_by_cross_coding

protected void code_bitmap_by_cross_coding(GBitmap bm,
                                           GBitmap cbm,
                                           int xd2c,
                                           int dw,
                                           int dy,
                                           int cy,
                                           int up1,
                                           int up0,
                                           int xup1,
                                           int xup0,
                                           int xdn1)
                                    throws java.io.IOException
DOCUMENT ME!

Specified by:
code_bitmap_by_cross_coding in class JB2Codec
Parameters:
bm - DOCUMENT ME!
cbm - DOCUMENT ME!
xd2c - DOCUMENT ME!
dw - DOCUMENT ME!
dy - DOCUMENT ME!
cy - DOCUMENT ME!
up1 - DOCUMENT ME!
up0 - DOCUMENT ME!
xup1 - DOCUMENT ME!
xup0 - DOCUMENT ME!
xdn1 - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

code_bitmap_directly

protected void code_bitmap_directly(GBitmap bm,
                                    int dw,
                                    int dy,
                                    int up2,
                                    int up1,
                                    int up0)
                             throws java.io.IOException
DOCUMENT ME!

Specified by:
code_bitmap_directly in class JB2Codec
Parameters:
bm - DOCUMENT ME!
dw - DOCUMENT ME!
dy - DOCUMENT ME!
up2 - DOCUMENT ME!
up1 - DOCUMENT ME!
up0 - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

code_comment

protected java.lang.String code_comment(java.lang.String comment)
                                 throws java.io.IOException
DOCUMENT ME!

Specified by:
code_comment in class JB2Codec
Parameters:
comment - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

code_image_size

protected void code_image_size(JB2Dict jim)
                        throws java.io.IOException
DOCUMENT ME!

Overrides:
code_image_size in class JB2Codec
Parameters:
jim - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.IllegalStateException - DOCUMENT ME!

code_image_size

protected void code_image_size(JB2Image jim)
                        throws java.io.IOException
DOCUMENT ME!

Overrides:
code_image_size in class JB2Codec
Parameters:
jim - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.IllegalStateException - DOCUMENT ME!

code_inherited_shape_count

protected void code_inherited_shape_count(JB2Dict jim)
                                   throws java.io.IOException
DOCUMENT ME!

Specified by:
code_inherited_shape_count in class JB2Codec
Parameters:
jim - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.IllegalStateException - DOCUMENT ME!

code_match_index

protected int code_match_index(int index,
                               JB2Dict ignored)
                        throws java.io.IOException
DOCUMENT ME!

Specified by:
code_match_index in class JB2Codec
Parameters:
index - DOCUMENT ME!
ignored - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

code_record_type

protected int code_record_type(int ignored)
                        throws java.io.IOException
DOCUMENT ME!

Specified by:
code_record_type in class JB2Codec
Parameters:
ignored - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

code_relative_mark_size

protected void code_relative_mark_size(GBitmap bm,
                                       int cw,
                                       int ch,
                                       int border)
                                throws java.io.IOException
DOCUMENT ME!

Specified by:
code_relative_mark_size in class JB2Codec
Parameters:
bm - DOCUMENT ME!
cw - DOCUMENT ME!
ch - DOCUMENT ME!
border - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.IllegalStateException - DOCUMENT ME!

get_diff

protected int get_diff(int ignored,
                       NumContext rel_loc)
                throws java.io.IOException
DOCUMENT ME!

Specified by:
get_diff in class JB2Codec
Parameters:
ignored - DOCUMENT ME!
rel_loc - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!