Class: Gifenc::Extension
- Inherits:
-
Object
- Object
- Gifenc::Extension
- Defined in:
- lib/extensions.rb
Overview
TODO:
Add support for the Plain Text Extension and the Comment Extension.
Generic container for GIF extensions. Extensions were added in the second and final specification of the GIF format in 1989, and implement additional and extensible functionality to GIF files.
Direct Known Subclasses
Defined Under Namespace
Classes: Application, GraphicControl, Netscape
Constant Summary collapse
- EXTENSION_INTRODUCER =
1-byte field indicating the beginning of an extension block.
'!'.freeze
Instance Method Summary collapse
-
#encode(stream) ⇒ Object
Encode the extension data to GIF format and write it to a stream.
-
#initialize(label) ⇒ Extension
constructor
Create a new generic extension block.
Constructor Details
#initialize(label) ⇒ Extension
Create a new generic extension block.
15 16 17 |
# File 'lib/extensions.rb', line 15 def initialize(label) @label = label end |
Instance Method Details
#encode(stream) ⇒ Object
Encode the extension data to GIF format and write it to a stream.
21 22 23 24 25 |
# File 'lib/extensions.rb', line 21 def encode(stream) stream << EXTENSION_INTRODUCER stream << @label # Extension label stream << body # Extension content end |