Class: Btape::GifEncoder::LzwCompressor::State

Inherits:
Struct
  • Object
show all
Defined in:
lib/btape/lzw_compressor.rb

Overview

Mutable state threaded through compress/advance: the growing code dictionary, the next free code, the current code width in bits, and whether a width bump is owed (see #advance).

Instance Attribute Summary collapse

Instance Attribute Details

#code_widthObject

Returns the value of attribute code_width

Returns:

  • (Object)

    the current value of code_width



16
17
18
# File 'lib/btape/lzw_compressor.rb', line 16

def code_width
  @code_width
end

#dictionaryObject

Returns the value of attribute dictionary

Returns:

  • (Object)

    the current value of dictionary



16
17
18
# File 'lib/btape/lzw_compressor.rb', line 16

def dictionary
  @dictionary
end

#next_codeObject

Returns the value of attribute next_code

Returns:

  • (Object)

    the current value of next_code



16
17
18
# File 'lib/btape/lzw_compressor.rb', line 16

def next_code
  @next_code
end

#pending_width_bumpObject

Returns the value of attribute pending_width_bump

Returns:

  • (Object)

    the current value of pending_width_bump



16
17
18
# File 'lib/btape/lzw_compressor.rb', line 16

def pending_width_bump
  @pending_width_bump
end