Class: RubyMarks::Config
- Inherits:
-
Object
- Object
- RubyMarks::Config
- Defined in:
- lib/ruby_marks/config.rb
Instance Attribute Summary collapse
-
#clock_height ⇒ Object
Returns the value of attribute clock_height.
-
#clock_mark_size_tolerance ⇒ Object
Returns the value of attribute clock_mark_size_tolerance.
-
#clock_marks_scan_x ⇒ Object
Returns the value of attribute clock_marks_scan_x.
-
#clock_width ⇒ Object
Returns the value of attribute clock_width.
-
#default_distance_between_marks ⇒ Object
Returns the value of attribute default_distance_between_marks.
-
#default_mark_height ⇒ Object
Returns the value of attribute default_mark_height.
-
#default_mark_width ⇒ Object
Returns the value of attribute default_mark_width.
-
#default_marks_options ⇒ Object
Returns the value of attribute default_marks_options.
-
#expected_clocks_count ⇒ Object
Returns the value of attribute expected_clocks_count.
-
#intensity_percentual ⇒ Object
Returns the value of attribute intensity_percentual.
-
#recognition_colors ⇒ Object
Returns the value of attribute recognition_colors.
-
#threshold_level ⇒ Object
Returns the value of attribute threshold_level.
Instance Method Summary collapse
- #calculated_threshold_level ⇒ Object
- #clock_height_tolerance_range ⇒ Object
- #clock_height_with_down_tolerance ⇒ Object
- #clock_height_with_up_tolerance ⇒ Object
- #clock_width_tolerance_range ⇒ Object
- #clock_width_with_down_tolerance ⇒ Object
- #clock_width_with_up_tolerance ⇒ Object
- #configure {|_self| ... } ⇒ Object
- #define_group(group_label, &block) ⇒ Object
-
#initialize(recognizer) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(recognizer) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ruby_marks/config.rb', line 11 def initialize(recognizer) @recognizer = recognizer @threshold_level = RubyMarks.threshold_level @intensity_percentual = RubyMarks.intensity_percentual @recognition_colors = RubyMarks.recognition_colors @expected_clocks_count = RubyMarks.expected_clocks_count @clock_marks_scan_x = RubyMarks.clock_marks_scan_x @clock_width = RubyMarks.clock_width @clock_height = RubyMarks.clock_height @clock_mark_size_tolerance = RubyMarks.clock_mark_size_tolerance @default_mark_width = RubyMarks.default_mark_width @default_mark_height = RubyMarks.default_mark_height @default_marks_options = RubyMarks. @default_distance_between_marks = RubyMarks.default_distance_between_marks end |
Instance Attribute Details
#clock_height ⇒ Object
Returns the value of attribute clock_height.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def clock_height @clock_height end |
#clock_mark_size_tolerance ⇒ Object
Returns the value of attribute clock_mark_size_tolerance.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def clock_mark_size_tolerance @clock_mark_size_tolerance end |
#clock_marks_scan_x ⇒ Object
Returns the value of attribute clock_marks_scan_x.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def clock_marks_scan_x @clock_marks_scan_x end |
#clock_width ⇒ Object
Returns the value of attribute clock_width.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def clock_width @clock_width end |
#default_distance_between_marks ⇒ Object
Returns the value of attribute default_distance_between_marks.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def default_distance_between_marks @default_distance_between_marks end |
#default_mark_height ⇒ Object
Returns the value of attribute default_mark_height.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def default_mark_height @default_mark_height end |
#default_mark_width ⇒ Object
Returns the value of attribute default_mark_width.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def default_mark_width @default_mark_width end |
#default_marks_options ⇒ Object
Returns the value of attribute default_marks_options.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def @default_marks_options end |
#expected_clocks_count ⇒ Object
Returns the value of attribute expected_clocks_count.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def expected_clocks_count @expected_clocks_count end |
#intensity_percentual ⇒ Object
Returns the value of attribute intensity_percentual.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def intensity_percentual @intensity_percentual end |
#recognition_colors ⇒ Object
Returns the value of attribute recognition_colors.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def recognition_colors @recognition_colors end |
#threshold_level ⇒ Object
Returns the value of attribute threshold_level.
6 7 8 |
# File 'lib/ruby_marks/config.rb', line 6 def threshold_level @threshold_level end |
Instance Method Details
#calculated_threshold_level ⇒ Object
30 31 32 |
# File 'lib/ruby_marks/config.rb', line 30 def calculated_threshold_level Magick::QuantumRange * (@threshold_level.to_f / 100) end |
#clock_height_tolerance_range ⇒ Object
54 55 56 |
# File 'lib/ruby_marks/config.rb', line 54 def clock_height_tolerance_range clock_height_with_down_tolerance..clock_height_with_up_tolerance end |
#clock_height_with_down_tolerance ⇒ Object
42 43 44 |
# File 'lib/ruby_marks/config.rb', line 42 def clock_height_with_down_tolerance @clock_height - @clock_mark_size_tolerance end |
#clock_height_with_up_tolerance ⇒ Object
46 47 48 |
# File 'lib/ruby_marks/config.rb', line 46 def clock_height_with_up_tolerance @clock_height + @clock_mark_size_tolerance end |
#clock_width_tolerance_range ⇒ Object
50 51 52 |
# File 'lib/ruby_marks/config.rb', line 50 def clock_width_tolerance_range clock_width_with_down_tolerance..clock_width_with_up_tolerance end |
#clock_width_with_down_tolerance ⇒ Object
34 35 36 |
# File 'lib/ruby_marks/config.rb', line 34 def clock_width_with_down_tolerance @clock_width - @clock_mark_size_tolerance end |
#clock_width_with_up_tolerance ⇒ Object
38 39 40 |
# File 'lib/ruby_marks/config.rb', line 38 def clock_width_with_up_tolerance @clock_width + @clock_mark_size_tolerance end |
#configure {|_self| ... } ⇒ Object
63 64 65 |
# File 'lib/ruby_marks/config.rb', line 63 def configure yield self if block_given? end |