Class: ShatteredMachine::Glitcher

Inherits:
Object
  • Object
show all
Defined in:
lib/shattered_machine/glitcher.rb

Overview

Main class to call from glitching image.

Instance Method Summary collapse

Constructor Details

#initialize(glitch_library, io, options = {}) ⇒ Glitcher

Returns a new instance of Glitcher.

Parameters:

  • glitch_library (string)

    Name of the library to call to glitch image

  • io (ShatteredMachine::Io)

    Io containing paths for images to glitch

  • options (Hash) (defaults to: {})

    options for the glitch algorithm



17
18
19
20
21
# File 'lib/shattered_machine/glitcher.rb', line 17

def initialize(glitch_library, io, options = {})
  @glitch_library = glitch_library
  @io = io
  @options = options
end

Instance Method Details

#callboolean

Returns status of glitching.

Returns:

  • (boolean)

    status of glitching



24
25
26
27
28
# File 'lib/shattered_machine/glitcher.rb', line 24

def call
  @io.png_images.each do |item|
    create_glitch(item.input, item.output)
  end
end