Class: RubySpriter::Processor
- Inherits:
-
Object
- Object
- RubySpriter::Processor
- Defined in:
- lib/ruby_spriter/processor.rb
Overview
Main orchestration processor
Constant Summary collapse
- VALID_RANGES =
Valid ranges for numeric options
{ frame_count: { min: 1, max: 10000, type: Integer }, columns: { min: 1, max: 100, type: Integer }, max_width: { min: 1, max: 1920, type: Integer }, scale_percent: { min: 1, max: 500, type: Integer }, grow_selection: { min: 0, max: 100, type: Integer }, sharpen_radius: { min: 0.1, max: 100.0, type: Float }, sharpen_gain: { min: 0.0, max: 10.0, type: Float }, sharpen_threshold: { min: 0.0, max: 1.0, type: Float }, bg_threshold: { min: 0.0, max: 100.0, type: Float } }.freeze
Instance Attribute Summary collapse
-
#gimp_path ⇒ Object
readonly
Returns the value of attribute gimp_path.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#split_columns ⇒ Object
readonly
Returns the value of attribute split_columns.
-
#split_rows ⇒ Object
readonly
Returns the value of attribute split_rows.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Processor
constructor
A new instance of Processor.
-
#run ⇒ Object
Run the processing workflow.
Constructor Details
#initialize(options = {}) ⇒ Processor
Returns a new instance of Processor.
25 26 27 28 29 30 31 32 33 |
# File 'lib/ruby_spriter/processor.rb', line 25 def initialize( = {}) @options = .merge() @gimp_path = nil @gimp_version = nil validate_split_option! validate_extract_option! end |
Instance Attribute Details
#gimp_path ⇒ Object (readonly)
Returns the value of attribute gimp_path.
10 11 12 |
# File 'lib/ruby_spriter/processor.rb', line 10 def gimp_path @gimp_path end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/ruby_spriter/processor.rb', line 10 def @options end |
#split_columns ⇒ Object (readonly)
Returns the value of attribute split_columns.
10 11 12 |
# File 'lib/ruby_spriter/processor.rb', line 10 def split_columns @split_columns end |
#split_rows ⇒ Object (readonly)
Returns the value of attribute split_rows.
10 11 12 |
# File 'lib/ruby_spriter/processor.rb', line 10 def split_rows @split_rows end |
Instance Method Details
#run ⇒ Object
Run the processing workflow
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ruby_spriter/processor.rb', line 36 def run check_dependencies! setup_temp_directory result = execute_workflow cleanup unless [:keep_temp] result end |