Class: Tracksperanto::Tool::Crop
Overview
Does the same as the Pad tool but with absolute pixel values instead of fractionals
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Methods included from Parameters
Methods included from SimpleExport
Methods included from ConstName
Methods included from BlockInit
Methods included from Casts
#cast_to_bool, #cast_to_float, #cast_to_int, #cast_to_string
Constructor Details
This class inherits a constructor from Tracksperanto::Tool::Base
Class Method Details
.action_description ⇒ Object
9 10 11 |
# File 'lib/tools/crop.rb', line 9 def self.action_description "Crop or pad the image by a specified number of pixels" end |
Instance Method Details
#start_export(w, h) ⇒ Object
13 14 15 16 17 |
# File 'lib/tools/crop.rb', line 13 def start_export(w, h) left_pad, right_pad, top_pad, bottom_pad = (left / w.to_f), (right / w.to_f), (top / h.to_f), (bottom / h.to_f) @pad = Tracksperanto::Tool::Pad.new(@exporter, :left_pad => left_pad, :right_pad => right_pad, :top_pad => top_pad, :bottom_pad => bottom_pad) @pad.start_export(w, h) end |