Class: SwfRuby::Swf::Shapewithstyle
- Inherits:
-
Object
- Object
- SwfRuby::Swf::Shapewithstyle
- Defined in:
- lib/swf_ruby/swf/shapewithstyle.rb
Instance Attribute Summary collapse
-
#after_line_styles ⇒ Object
Returns the value of attribute after_line_styles.
-
#fill_styles_with_offset ⇒ Object
Returns the value of attribute fill_styles_with_offset.
-
#shape_version ⇒ Object
Returns the value of attribute shape_version.
Instance Method Summary collapse
-
#initialize(bytearray, shape_version) ⇒ Shapewithstyle
constructor
A new instance of Shapewithstyle.
Constructor Details
#initialize(bytearray, shape_version) ⇒ Shapewithstyle
Returns a new instance of Shapewithstyle.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/swf_ruby/swf/shapewithstyle.rb', line 10 def initialize(bytearray, shape_version) @shape_version = shape_version fill_style_count = bytearray[0, 1].unpack("C").first offset = 1 if fill_style_count == 255 fill_style_count = bytearray[1, 2].unpack("v").first offset += 2 end @fill_styles_with_offset = {} fill_style_count.times do fill_style = SwfRuby::Swf::Fillstyle.new(bytearray[offset..-1], @shape_version) @fill_styles_with_offset[offset] = fill_style offset += fill_style.length end # TODO after_line_styles are including outside tag data.. @after_line_styles = bytearray[offset..-1] self end |
Instance Attribute Details
#after_line_styles ⇒ Object
Returns the value of attribute after_line_styles.
8 9 10 |
# File 'lib/swf_ruby/swf/shapewithstyle.rb', line 8 def after_line_styles @after_line_styles end |
#fill_styles_with_offset ⇒ Object
Returns the value of attribute fill_styles_with_offset.
7 8 9 |
# File 'lib/swf_ruby/swf/shapewithstyle.rb', line 7 def fill_styles_with_offset @fill_styles_with_offset end |
#shape_version ⇒ Object
Returns the value of attribute shape_version.
6 7 8 |
# File 'lib/swf_ruby/swf/shapewithstyle.rb', line 6 def shape_version @shape_version end |