Text
[ class tree: Text ] [ index: Text ] [ all elements ]

Class: Text_HuffmanCompress

Source Location: /Text_Huffman-0.2.0/HuffmanCompress.php

Class Overview

Text_Huffman
   |
   --Text_HuffmanCompress

Huffman Compression Class


Variables

Methods


Inherited Variables

Inherited Methods

Class: Text_Huffman

Text_Huffman::__construct()
Constructor
Text_Huffman::setFiles()
setFiles() is called to specify the paths to the input and output files.
Text_Huffman::_bitRead()
Bit-reading with a carrier: input 8 bits at a time.
Text_Huffman::_bitRead1()
Read 1 bit.
Text_Huffman::_bitWrite()
Bit-writing with a carrier: output every 8 bits
Text_Huffman::_bitWriteEnd()
Finalizing bit-writing, writing the data.
Text_Huffman::_decBinDig()
Returns the binary representation of $x as a string, over $n digits, with as many initial zeros as necessary to cover that.

Class Details

[line 37]
Huffman Compression Class


[ Top ]


Class Variables

$_codelens =

[line 68]

Array of character code lengths
  • Access: protected

Type:   mixed


[ Top ]

$_codes =

[line 62]

Array of character codes
  • Access: protected

Type:   mixed


[ Top ]

$_hroot =

[line 56]

Index of the root of the Huffman tree
  • Access: protected

Type:   mixed


[ Top ]

$_ifsize =

[line 44]

Size of the input file, in bytes
  • Access: protected

Type:   mixed


[ Top ]

$_occ =

[line 50]

Array of letter occurrences
  • Access: protected

Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 78]

Text_HuffmanCompress __construct( )

Constructor
  • Access: public

Overrides Text_Huffman::__construct() (Constructor)
[ Top ]

compress   [line 94]

void compress( )

Perform compression.
  • Access: public

[ Top ]

getCompressionRatio   [line 192]

void getCompressionRatio( )

Calculate compression ration.
  • Access: public

[ Top ]

getSCodes   [line 157]

void getSCodes( )

Show info on characters codes created from the Huffman tree.
  • Access: public

[ Top ]

setFiles   [line 143]

void setFiles( [ $ifile = ''], [ $ofile = ''])

setFiles() is called to specify the paths to the input and output files.

It calls a parent function for its role, then sets some compression- specific variables concerning files.

  • Access: public

Overrides Text_Huffman::setFiles() (setFiles() is called to specify the paths to the input and output files.)

Parameters:

   $ifile   — 
   $ofile   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:54:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.