Sha256: 36b6b98836ca8cd2fdb8b1b848111e53694657803f57d760a7856076f2698779

Contents?: true

Size: 570 Bytes

Versions: 4

Compression:

Stored size: 570 Bytes

Contents

require 'rmagick'

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

  def initialize(image: image)
    @img = image
    find_edges 
  end

  def find_edges
    width = @img.columns / 2
    height = @img.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

4 entries across 4 versions & 1 rubygems

Version Path
sqed-0.1.9 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.1.8 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.1.7 lib/sqed/boundary_finder/cross_finder.rb
sqed-0.1.6 lib/sqed/boundary_finder/cross_finder.rb