Class: Screenpress::Compare::Bits
- Inherits:
-
Object
- Object
- Screenpress::Compare::Bits
- Includes:
- ChunkyPNG::Color
- Defined in:
- lib/screenpress/compare/bits.rb
Instance Attribute Summary collapse
-
#fresh_image ⇒ Object
readonly
Returns the value of attribute fresh_image.
-
#orig_image ⇒ Object
readonly
Returns the value of attribute orig_image.
Instance Method Summary collapse
- #difference ⇒ Object
-
#initialize(orig_path, fresh_path) ⇒ Bits
constructor
A new instance of Bits.
- #threshold ⇒ Object
Constructor Details
#initialize(orig_path, fresh_path) ⇒ Bits
Returns a new instance of Bits.
11 12 13 14 15 |
# File 'lib/screenpress/compare/bits.rb', line 11 def initialize(orig_path, fresh_path) @orig_image = ChunkyPNG::Image.from_file(orig_path) @fresh_image = ChunkyPNG::Image.from_file(fresh_path) @diff_index = [] end |
Instance Attribute Details
#fresh_image ⇒ Object (readonly)
Returns the value of attribute fresh_image.
10 11 12 |
# File 'lib/screenpress/compare/bits.rb', line 10 def fresh_image @fresh_image end |
#orig_image ⇒ Object (readonly)
Returns the value of attribute orig_image.
10 11 12 |
# File 'lib/screenpress/compare/bits.rb', line 10 def orig_image @orig_image end |
Instance Method Details
#difference ⇒ Object
17 18 19 20 |
# File 'lib/screenpress/compare/bits.rb', line 17 def difference diff_iterator percentage_diff end |
#threshold ⇒ Object
22 23 24 |
# File 'lib/screenpress/compare/bits.rb', line 22 def threshold Screenpress.config.threshold || 0.1 end |