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