Class: Tracksperanto::Import::FlameStabilizer

Inherits:
Base
  • Object
show all
Defined in:
lib/import/flame_stabilizer.rb

Defined Under Namespace

Classes: ChannelBlock

Constant Summary collapse

T =
::Tracksperanto::Tracker
K =
::Tracksperanto::Keyframe

Instance Attribute Summary

Attributes inherited from Base

#height, #progress_block, #width

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, #report_progress

Methods included from ZipTuples

#zip_curve_tuples

Methods included from BlockInit

#initialize

Methods included from Casts

#cast_to_float, #cast_to_int, #cast_to_string, included

Methods included from Safety

included, #safe_reader

Class Method Details

.autodetects_size?Boolean

Flame setups contain clear size indications

Returns:

  • (Boolean)


5
6
7
# File 'lib/import/flame_stabilizer.rb', line 5

def self.autodetects_size?
  true
end

.distinct_file_extObject



9
10
11
# File 'lib/import/flame_stabilizer.rb', line 9

def self.distinct_file_ext
  ".stabilizer"
end

.human_nameObject



13
14
15
# File 'lib/import/flame_stabilizer.rb', line 13

def self.human_name
  "Flame .stabilizer file"
end

Instance Method Details

#parse(io) ⇒ Object



72
73
74
75
76
77
78
79
80
# File 'lib/import/flame_stabilizer.rb', line 72

def parse(io)
  self.width, self.height = extract_width_and_height_from_stream(io)
  channels = extract_channels_from_stream(io)
  
  raise "The setup contained no channels that we could process" if channels.empty?
  raise "A channel was nil" if channels.find{|e| e.nil? }
  
  scavenge_trackers_from_channels(channels)
end