overmapper.rb
# Find seen files and record overview data
Find seen files and record overview data
Find seen files and record overview data
def overview(save_path)
  seen = Hash.new
  n = w = s = e = 0
  Dir.glob(File.join(save_path, '#*.seen.*')).each do |f|
    x, y = f.match(/seen\.(-?\d+)\.(-?\d+)$/).captures.map(&:to_i)
    seen["#{x} #{y}"] = f
    w = x if x < w
    e = x if x > e
    n = y if y > n
    s = y if y < s
  end
  width = e + w.abs + 1
  height = n + s.abs + 1
  Overview.new(seen, width, height, n, s, w, e)
end
def overview ( save_path ) seen = Hash . new n = w = s = e = 0 Dir . glob ( File . join ( save_path , '#*.seen.*' ) ) . each do | f | x , y = f . match ( / seen \. (-? \d +) \. (-? \d +)$ / ) . captures . map ( & :to_i ) seen [ "#{x} #{y}" ] = f w = x if x < w e = x if x > e n = y if y > n s = y if y < s end width = e + w . abs + 1 height = n + s . abs + 1 Overview . new ( seen , width , height , n , s , w , e ) end
Find seen files and record overview data
Find seen files and record overview data
save_path