class ShatteredMachine::Glitcher
Main class to call from glitching image.
Public Class Methods
new(glitch_library, io, options = {})
click to toggle source
@param glitch_library [string] Name of the library to call to glitch image @param io [ShatteredMachine::Io] Io
containing paths for images to glitch @param options [Hash] options for the glitch algorithm
# File lib/shattered_machine/glitcher.rb, line 17 def initialize(glitch_library, io, options = {}) @glitch_library = glitch_library @io = io @options = options end
Public Instance Methods
call()
click to toggle source
@return [boolean] status of glitching
# File lib/shattered_machine/glitcher.rb, line 24 def call @io.png_images.each do |item| create_glitch(item.input, item.output) end end
Private Instance Methods
create_glitch(input_path, output_filename)
click to toggle source
# File lib/shattered_machine/glitcher.rb, line 36 def create_glitch(input_path, output_filename) Object.const_get(glitch_library_name) .new(@options) .call(input_path, output_filename) return true end
glitch_library_name()
click to toggle source
# File lib/shattered_machine/glitcher.rb, line 32 def glitch_library_name "ShatteredMachine::#{@glitch_library}" end