Class: Diffux::SnapshotComparisonImage::After

Inherits:
Base
  • Object
show all
Defined in:
lib/diffux_core/snapshot_comparison_image/after.rb

Overview

This subclass of ‘SnapshotComparisonImage` knows how to draw the representation of the “after” image.

Constant Summary

Constants inherited from Base

Base::BASE_ALPHA, Base::BASE_DIFF_ALPHA, Base::BASE_OPACITY, Base::GREEN, Base::MAGENTA, Base::RED

Instance Method Summary collapse

Methods inherited from Base

#diff_alpha, #initialize, #pixel_diff_score, #render_deleted_row, #render_pixel, #render_row, #render_unchanged_row

Constructor Details

This class inherits a constructor from Diffux::SnapshotComparisonImage::Base

Instance Method Details

#render_added_row(y, row) ⇒ Object

Parameters:

  • y (Integer)
  • row (Diff::LCS:ContextChange)


14
15
16
17
18
# File 'lib/diffux_core/snapshot_comparison_image/after.rb', line 14

def render_added_row(y, row)
  row.new_element.each_with_index do |pixel_after, x|
    render_pixel(x, y, pixel_after)
  end
end

#render_changed_row(y, row) ⇒ Object

Parameters:

  • y (Integer)
  • row (Diff::LCS:ContextChange)


8
9
10
# File 'lib/diffux_core/snapshot_comparison_image/after.rb', line 8

def render_changed_row(y, row)
  render_added_row(y, row)
end