Class: ImageMosaic::Operations::Compositor
- Inherits:
-
Object
- Object
- ImageMosaic::Operations::Compositor
- Defined in:
- lib/image_mosaic/operations/compositor.rb
Overview
Takes a composite_image Can then place another image over the top at x, y coordinates and resized to a dimension.
Instance Method Summary collapse
-
#initialize(composite_image, child) ⇒ Compositor
constructor
A new instance of Compositor.
- #save(type: 'Over') ⇒ Object
Constructor Details
#initialize(composite_image, child) ⇒ Compositor
Returns a new instance of Compositor.
6 7 8 9 |
# File 'lib/image_mosaic/operations/compositor.rb', line 6 def initialize(composite_image, child) @composite_image = composite_image @child = child end |
Instance Method Details
#save(type: 'Over') ⇒ Object
11 12 13 14 15 16 |
# File 'lib/image_mosaic/operations/compositor.rb', line 11 def save(type: 'Over') @composite_image.composite(image) do |composite| composite.compose type composite.geometry "+#{@child[:x]}+#{@child[:y]}" end end |