Class: Imatcher::Modes::Delta

Inherits:
Base
  • Object
show all
Defined in:
lib/imatcher/modes/delta.rb

Overview

Compare pixels using Delta E distance.

Instance Attribute Summary collapse

Attributes inherited from Base

#bounds, #exclude_rect, #include_rect, #result, #threshold

Instance Method Summary collapse

Methods inherited from Base

#area, #compare, #diff, #update_bounds

Methods included from ColorMethods

#blue, #brightness, #green, #red

Constructor Details

#initialize(options) ⇒ Delta

Returns a new instance of Delta.



9
10
11
12
13
# File 'lib/imatcher/modes/delta.rb', line 9

def initialize(options)
  @tolerance = options.delete(:tolerance) || 0.01
  @delta_score = 0.0
  super(options)
end

Instance Attribute Details

#toleranceObject (readonly)

Returns the value of attribute tolerance.



7
8
9
# File 'lib/imatcher/modes/delta.rb', line 7

def tolerance
  @tolerance
end