Class: RubyMarks::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_marks/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(recognizer) ⇒ Config

Returns a new instance of Config.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ruby_marks/config.rb', line 14

def initialize(recognizer)
  @recognizer = recognizer
  @threshold_level = RubyMarks.threshold_level
  @edge_level = RubyMarks.edge_level
  @scan_timeout = RubyMarks.scan_timeout

  @intensity_percentual = RubyMarks.intensity_percentual
  
  @default_block_width_tolerance  = RubyMarks.default_block_width_tolerance
  @default_block_height_tolerance = RubyMarks.default_block_height_tolerance

  @default_mark_width  = RubyMarks.default_mark_width
  @default_mark_height = RubyMarks.default_mark_height

  @default_mark_width_tolerance  = RubyMarks.default_mark_width_tolerance
  @default_mark_height_tolerance = RubyMarks.default_mark_height_tolerance
  
  @default_marks_options = RubyMarks.default_marks_options
  @default_distance_between_marks = RubyMarks.default_distance_between_marks
  @default_expected_lines = RubyMarks.default_expected_lines      
end

Instance Attribute Details

#auto_ajust_block_heightObject

Returns the value of attribute auto_ajust_block_height.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def auto_ajust_block_height
  @auto_ajust_block_height
end

#auto_ajust_block_widthObject

Returns the value of attribute auto_ajust_block_width.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def auto_ajust_block_width
  @auto_ajust_block_width
end

#default_block_height_toleranceObject

Returns the value of attribute default_block_height_tolerance.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def default_block_height_tolerance
  @default_block_height_tolerance
end

#default_block_width_toleranceObject

Returns the value of attribute default_block_width_tolerance.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def default_block_width_tolerance
  @default_block_width_tolerance
end

#default_distance_between_marksObject

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_expected_linesObject

Returns the value of attribute default_expected_lines.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def default_expected_lines
  @default_expected_lines
end

#default_mark_heightObject

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_height_toleranceObject

Returns the value of attribute default_mark_height_tolerance.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def default_mark_height_tolerance
  @default_mark_height_tolerance
end

#default_mark_widthObject

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_mark_width_toleranceObject

Returns the value of attribute default_mark_width_tolerance.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def default_mark_width_tolerance
  @default_mark_width_tolerance
end

#default_marks_optionsObject

Returns the value of attribute default_marks_options.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def default_marks_options
  @default_marks_options
end

#edge_levelObject

Returns the value of attribute edge_level.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def edge_level
  @edge_level
end

#intensity_percentualObject

Returns the value of attribute intensity_percentual.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def intensity_percentual
  @intensity_percentual
end

#scan_modeObject

Returns the value of attribute scan_mode.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def scan_mode
  @scan_mode
end

#scan_timeoutObject

Returns the value of attribute scan_timeout.



6
7
8
# File 'lib/ruby_marks/config.rb', line 6

def scan_timeout
  @scan_timeout
end

#threshold_levelObject

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_levelObject



36
37
38
# File 'lib/ruby_marks/config.rb', line 36

def calculated_threshold_level
  Magick::QuantumRange * (@threshold_level.to_f / 100)
end

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



45
46
47
# File 'lib/ruby_marks/config.rb', line 45

def configure
  yield self if block_given?
end

#define_group(group_label, &block) ⇒ Object



40
41
42
43
# File 'lib/ruby_marks/config.rb', line 40

def define_group(group_label, &block)
  group = RubyMarks::Group.new(group_label, @recognizer, &block)
  @recognizer.add_group(group)
end