Sha256: aa4a026f41fdee09053d13856b87e20ff904670e506ad08b8dbde0b20b0a457d

Contents?: true

Size: 574 Bytes

Versions: 21

Compression:

Stored size: 574 Bytes

Contents

require 'rmagick'

# Return four equal quadrants, no parsing through the image
#
class Sqed::BoundaryFinder::CrossFinder < Sqed::BoundaryFinder

  def initialize(**opts)
    @image = opts[:image]
    find_edges
  end

  def find_edges
    width = image.columns / 2
    height = image.rows / 2

    boundaries.coordinates[0] = [0, 0, width, height] 
    boundaries.coordinates[1] = [width, 0, width, height] 
    boundaries.coordinates[2] = [width, height, width, height] 
    boundaries.coordinates[3] = [0, height, width, height] 
    boundaries.complete = true
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
sqed-0.8.3 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.8.2 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.8.1 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.8.0 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.7.1 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.7.0 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.6.0 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.8 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.7 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.6 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.5 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.4 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.3 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.2 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.1 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.5.0 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.4.4 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.4.3 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.4.2 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.4.1 lib/sqed/boundary_finder/cross_finder.rb