Class: ImageProcessing::Vips::Pipeline
- Inherits:
-
Object
- Object
- ImageProcessing::Vips::Pipeline
- Includes:
- Chainable
- Defined in:
- lib/image_processing/vips/pipeline.rb
Instance Method Summary collapse
- #call!(save: true) ⇒ Object
-
#initialize(options) ⇒ Pipeline
constructor
A new instance of Pipeline.
Methods included from Chainable
#branch, #call, #convert, #custom, #default_options, #loader, #method_missing, #operation, #saver, #source
Constructor Details
#initialize(options) ⇒ Pipeline
Returns a new instance of Pipeline.
6 7 8 |
# File 'lib/image_processing/vips/pipeline.rb', line 6 def initialize() @default_options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ImageProcessing::Vips::Chainable
Instance Method Details
#call!(save: true) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/image_processing/vips/pipeline.rb', line 10 def call!(save: true) processor = Processor.new([:source]) image = processor.load_image([:loader]) [:operations].each do |name, args| if name == :custom image = args.first.call(image) else image = processor.apply_operation(name, image, *args) end end if save processor.save_image(image, [:format], [:saver]) else image end end |