Class: ImageVise::Geom

Inherits:
Object
  • Object
show all
Defined in:
lib/image_vise/operators/geom.rb

Overview

Applies a transformation using an ImageMagick geometry string

The corresponding Pipeline method is ‘geom`.

Instance Method Summary collapse

Constructor Details

#initializeGeom

Returns a new instance of Geom.

Raises:

  • (ArgumentError)


5
6
7
8
9
# File 'lib/image_vise/operators/geom.rb', line 5

def initialize(*)
  super
  self.geometry_string = geometry_string.to_s
  raise ArgumentError, "the :geom parameter must be present and not empty" if self.geometry_string.empty?
end

Instance Method Details

#apply!(image) ⇒ Object



11
12
13
# File 'lib/image_vise/operators/geom.rb', line 11

def apply!(image)
  image.change_geometry(geometry_string) { |cols, rows, _| image.resize!(cols,rows) }
end