Libraries |
|
LZW | Source Code |
|
|
Function Summary | |||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
| ||||
string |
|
Function Detail |
lzwCompressLsb
const func string: lzwCompressLsb (in string: uncompressed, in integer: codeSize)
-
Compress a string with the Lempel-Ziv-Welch (LZW) compression method. The packing order of bits in bytes is LSB-First (Least Significant Bit First). This compression method is used for GIF files. Compressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- uncompressed - Data to be compressed
- codeSize - Number of bits used by the uncompressed data.
- Returns:
- a compressed byte string created from the uncompressed data.
lzwDecompress
const func string: lzwDecompress (inout lsbInBitStream: compressedStream, in integer: codeSize)
-
Decompress a Lempel-Ziv-Welch (LZW) compressed lsbInBitStream. The packing order of bits in bytes is LSB-First (Least Significant Bit First). This compression method is used for GIF files. Decompressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- compressed - Byte string to be decompressed.
- codeSize - Number of bits used by the decompressed data.
- Returns:
- the decompressed data created from compressedStream.
lzwDecompressLsb
const func string: lzwDecompressLsb (in string: compressed, in integer: codeSize)
-
Decompress a Lempel-Ziv-Welch (LZW) compressed string. The packing order of bits in bytes is LSB-First (Least Significant Bit First). This compression method is used for GIF files. Decompressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- compressed - Byte string to be decompressed.
- codeSize - Number of bits used by the decompressed data.
- Returns:
- the decompressed data created from the compressed string.
lzwCompressMsb
const func string: lzwCompressMsb (in string: uncompressed, in integer: codeSize)
-
Compress a string with the Lempel-Ziv-Welch (LZW) compression method. The packing order of bits in bytes is MSB-First (Most Significant Bit First). This compression method is used in PDF files. Compressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- uncompressed - Data to be compressed
- codeSize - Number of bits used by the uncompressed data.
- Returns:
- a compressed byte string created from the uncompressed data.
lzwDecompress
const func string: lzwDecompress (inout msbInBitStream: compressedStream, in integer: codeSize)
-
Decompress a Lempel-Ziv-Welch (LZW) compressed msbInBitStream. The packing order of bits in bytes is MSB-First (Most Significant Bit First). This compression method is used in PDF files. Decompressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- compressed - Byte string to be decompressed.
- codeSize - Number of bits used by the decompressed data.
- Returns:
- the decompressed data created from compressedStream.
lzwDecompressMsb
const func string: lzwDecompressMsb (in string: compressed, in integer: codeSize)
-
Decompress a Lempel-Ziv-Welch (LZW) compressed string. The packing order of bits in bytes is MSB-First (Most Significant Bit First). This compression method is used in PDF files. Decompressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- compressed - Byte string to be decompressed.
- codeSize - Number of bits used by the decompressed data.
- Returns:
- the decompressed data created from the compressed string.
lzwCompressMsbEarlyChange
const func string: lzwCompressMsbEarlyChange (in string: uncompressed, in integer: codeSize)
-
Compress a string with the Lempel-Ziv-Welch (LZW) compression method. The packing order of bits in bytes is MSB-First (Most Significant Bit First). This compression method is used in TIFF and PDF files. EarlyChange means that the encoding width changes one code too early. Compressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- uncompressed - Data to be compressed
- codeSize - Number of bits used by the uncompressed data.
- Returns:
- a compressed byte string created from the uncompressed data.
lzwDecompressEarlyChange
const func string: lzwDecompressEarlyChange (inout msbInBitStream: compressedStream, in integer: codeSize)
-
Decompress a Lempel-Ziv-Welch (LZW) compressed msbInBitStream. The packing order of bits in bytes is MSB-First (Most Significant Bit First). This compression method is used in TIFF and PDF files. EarlyChange means that the encoding width changes one code too early. Decompressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- compressed - Byte string to be decompressed.
- codeSize - Number of bits used by the decompressed data.
- Returns:
- the decompressed data created from compressedStream.
lzwDecompressMsbEarlyChange
const func string: lzwDecompressMsbEarlyChange (in string: compressed, in integer: codeSize)
-
Decompress a Lempel-Ziv-Welch (LZW) compressed string. The packing order of bits in bytes is MSB-First (Most Significant Bit First). This compression method is used in TIFF and PDF files. EarlyChange means that the encoding width changes one code too early. Decompressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- compressed - Byte string to be decompressed.
- codeSize - Number of bits used by the decompressed data.
- Returns:
- the decompressed data created from the compressed string.
lzwDecompressEarlyChange
const func string: lzwDecompressEarlyChange (inout msbInBitStream: compressedStream, in integer: codeSize, in integer: requestedLength)
-
Decompress a Lempel-Ziv-Welch (LZW) compressed msbInBitStream. The packing order of bits in bytes is MSB-First (Most Significant Bit First). This compression method is used in TIFF and PDF files. EarlyChange means that the encoding width changes one code too early. Decompressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- compressed - Byte string to be decompressed.
- codeSize - Number of bits used by the decompressed data.
- requestedLength - Number of decompressed bytes to be read.
- Returns:
- the decompressed data created from compressedStream.
lzwDecompressMsbEarlyChange
const func string: lzwDecompressMsbEarlyChange (in string: compressed, in integer: codeSize, in integer: requestedLength)
-
Decompress a Lempel-Ziv-Welch (LZW) compressed string. The packing order of bits in bytes is MSB-First (Most Significant Bit First). This compression method is used in TIFF and PDF files. EarlyChange means that the encoding width changes one code too early. Decompressing starts with succ(codeSize) bits per coding point and goes up to 12 bits per coding point. The code points 0 to pred(2 ** codeSize) correspond to unchanged data. Code 2 ** codeSize starts a new block with a new table and succ(codeSize) bits per code point. Code succ(2 ** codeSize) marks the end of the compressed data.
- Parameters:
- compressed - Byte string to be decompressed.
- codeSize - Number of bits used by the decompressed data.
- requestedLength - Number of decompressed bytes to be read.
- Returns:
- the decompressed data created from the compressed string.
lzwDecompressShrink
const func string: lzwDecompressShrink (inout lsbInBitStream: compressedStream)
-
Decompress a Shrink (=LZW) compressed lsbInBitStream. The packing order of bits in bytes is LSB-First (Least Significant Bit First). This compression method is used for ZIP files. Decompressing starts with 9 bits per coding point and goes up to 13 bits per coding point. The code points 0 to 255 correspond to unchanged data. Code 256 is used as control code. If the contol code is followed by code 1 the number of bits per coding point is increased. If the contol code is followed by code 2 the coding points without children are put to the list of available codes.
- Parameters:
- compressed - Byte string to be decompressed.
- Returns:
- the decompressed data created from compressedStream.
|
|