Package net.sourceforge.jiu.codecs.jpeg

# Class JPEGHuffmanTable

java.lang.Object
net.sourceforge.jiu.codecs.jpeg.JPEGHuffmanTable

public class JPEGHuffmanTable extends Object
Data class that stores a single Huffman table, including class (AC or DC), ID and codes for the 16 possible bit lengths from 1 to 16.

Since:
  0.13.0
Author:
  Marco Schmidt

## Field Summary

Fields
Modifier and Type
Field
Description
`private int`
`classAcDc`
`private int[][]`
`codes`
`private int[]`
`huffCode`
`private int[]`
`huffSize`
`private int`
`id`
`private int`
`lastK`
`static final int`
`TABLE_CLASS_AC`
`static final int`
`TABLE_CLASS_DC`

## Constructor Summary

Constructors
Constructor
Description
`JPEGHuffmanTable()`

## Method Summary

Modifier and Type
Method
Description
`void`
`createDecoderTables()`
`private void`
`generateCodeTable()`
Initialize huffCode from huffSize.
`private void`
`generateSizeTable()`
Initialize huffSize and lastK from codes.
`int`
`getClassAcDc()`
`int[][]`
`getCodes()`
`int`
`getId()`
`void`
`setClassAcDc(int i)`
`void`
`setCodes(int[][] is)`
`void`
`setId(int i)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### TABLE_CLASS_AC

public static final int TABLE_CLASS_AC

See Also:
  - Constant Field Values

### TABLE_CLASS_DC

public static final int TABLE_CLASS_DC

See Also:
  - Constant Field Values

### id

private int id

### classAcDc

private int classAcDc

### codes

private int[][] codes

### huffCode

private int[] huffCode

### huffSize

private int[] huffSize

### lastK

private int lastK

## Constructor Details

### JPEGHuffmanTable

public JPEGHuffmanTable()

## Method Details

### createDecoderTables

public void createDecoderTables()

### generateCodeTable

private void generateCodeTable()
Initialize huffCode from huffSize. Pinvalid input: '&M' figure C.2, p. 406f.

### generateSizeTable

private void generateSizeTable()
Initialize huffSize and lastK from codes. Pinvalid input: '&M' figure C.1, p. 405f.

### getClassAcDc

public int getClassAcDc()

### getCodes

public int[][] getCodes()

### getId

public int getId()

### setClassAcDc

public void setClassAcDc(int i)

### setCodes

public void setCodes(int[][] is)

### setId

public void setId(int i)

### toString

public String toString()

Overrides:
  `toString` in class `Object`