Class: ShatteredMachine::WrongFilter
- Inherits:
-
Object
- Object
- ShatteredMachine::WrongFilter
- Defined in:
- lib/shattered_machine/wrong_filter.rb
Overview
Use the wrong filter algorithm from pnglitch on a given png image.
Instance Method Summary collapse
-
#call(input_image, output_image) ⇒ boolean
Status of wrong filter.
-
#initialize(options = {}) ⇒ WrongFilter
constructor
A new instance of WrongFilter.
Constructor Details
#initialize(options = {}) ⇒ WrongFilter
Returns a new instance of WrongFilter.
8 9 10 |
# File 'lib/shattered_machine/wrong_filter.rb', line 8 def initialize( = {}) @filter = [:filter] || 'average' end |
Instance Method Details
#call(input_image, output_image) ⇒ boolean
Returns status of wrong filter.
15 16 17 18 19 20 |
# File 'lib/shattered_machine/wrong_filter.rb', line 15 def call(input_image, output_image) PNGlitch.open(input_image) do |png| filtered_glitch(png, @filter).save output_image end output_image end |