Class: SwfHeader
- Inherits:
-
Object
- Object
- SwfHeader
- Includes:
- Compression
- Defined in:
- lib/swf_file/swf_header.rb
Instance Attribute Summary collapse
-
#avm_version ⇒ Object
readonly
Returns the value of attribute avm_version.
-
#bit_count ⇒ Object
readonly
Returns the value of attribute bit_count.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#frame_count ⇒ Object
readonly
Returns the value of attribute frame_count.
-
#frame_rate ⇒ Object
readonly
Returns the value of attribute frame_rate.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
-
#xmax ⇒ Object
readonly
Returns the value of attribute xmax.
-
#ymax ⇒ Object
readonly
Returns the value of attribute ymax.
Instance Method Summary collapse
- #compressed?(memoize_result = true) ⇒ Boolean
-
#duration ⇒ Object
Returns the duration in milliseconds.
-
#initialize(swf_file) ⇒ SwfHeader
constructor
A new instance of SwfHeader.
- #to_hash ⇒ Object (also: #inspect)
- #to_s ⇒ Object
Constructor Details
#initialize(swf_file) ⇒ SwfHeader
Returns a new instance of SwfHeader.
8 9 10 11 12 |
# File 'lib/swf_file/swf_header.rb', line 8 def initialize(swf_file) @file = swf_file parse_header parse_packed_bits end |
Instance Attribute Details
#avm_version ⇒ Object (readonly)
Returns the value of attribute avm_version.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def avm_version @avm_version end |
#bit_count ⇒ Object (readonly)
Returns the value of attribute bit_count.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def bit_count @bit_count end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def file @file end |
#frame_count ⇒ Object (readonly)
Returns the value of attribute frame_count.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def frame_count @frame_count end |
#frame_rate ⇒ Object (readonly)
Returns the value of attribute frame_rate.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def frame_rate @frame_rate end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def height @height end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def signature @signature end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def size @size end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def version @version end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def width @width end |
#xmax ⇒ Object (readonly)
Returns the value of attribute xmax.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def xmax @xmax end |
#ymax ⇒ Object (readonly)
Returns the value of attribute ymax.
4 5 6 |
# File 'lib/swf_file/swf_header.rb', line 4 def ymax @ymax end |
Instance Method Details
#compressed?(memoize_result = true) ⇒ Boolean
14 15 16 |
# File 'lib/swf_file/swf_header.rb', line 14 def compressed?(memoize_result = true) buffer_compressed?(memoize_result) end |
#duration ⇒ Object
Returns the duration in milliseconds
19 20 21 |
# File 'lib/swf_file/swf_header.rb', line 19 def duration ((@frame_count / @frame_rate.to_f).round(5) * 1000).round end |
#to_hash ⇒ Object Also known as: inspect
27 28 29 |
# File 'lib/swf_file/swf_header.rb', line 27 def to_hash Conversions::Hash.from_swf_header self end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/swf_file/swf_header.rb', line 23 def to_s "#{@file} #{@width}x#{@height} #{@frame_rate}fps" end |