lib/image_mosaic.rb in image_mosaic-0.1.0 vs lib/image_mosaic.rb in image_mosaic-0.1.1
- old
+ new
@@ -1,15 +1,19 @@
require "image_mosaic/version"
require 'mini_magick'
require 'tempfile'
require 'securerandom'
require 'image_mosaic/operations/compositor'
+require 'image_mosaic/data/setting'
require 'image_mosaic/data/validator'
require 'image_mosaic/image/parent'
require 'image_mosaic/image/child'
module ImageMosaic
+ HEIGHT = 1000
+ WIDTH = 1000
+
class Construct
def initialize(items)
@items = items
end
@@ -18,10 +22,14 @@
end
private
def parent
- @parent ||= Image::Parent.new(valid_items).create
+ @parent ||= Image::Parent.new(valid_items, colour: 'white', columns: setting.columns, dimension: setting.dimension).create
+ end
+
+ def setting
+ @setting ||= Data::Setting.new(valid_items.count)
end
def valid_items
@valid_items ||= Data::Validator.new(@items).items
end