Class: ImageVise::Geom
- Inherits:
-
Object
- Object
- ImageVise::Geom
- 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
- #apply!(image) ⇒ Object
-
#initialize ⇒ Geom
constructor
A new instance of Geom.
Constructor Details
#initialize ⇒ Geom
Returns a new instance of Geom.
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 |