Class: ShatteredMachine::Slim
- Inherits:
-
Object
- Object
- ShatteredMachine::Slim
- Defined in:
- lib/shattered_machine/slim.rb
Overview
Repeat pixels of a given png image. The logic for the pixel sorter come from the Rusty Engine.
Constant Summary collapse
- ALL_COLORS =
%i[white black grey red green blue cyan yellow magenta].freeze
Instance Method Summary collapse
-
#call(input_image, output_image) ⇒ boolean
Status of slim.
-
#initialize(options = {}) ⇒ Slim
constructor
A new instance of Slim.
Constructor Details
#initialize(options = {}) ⇒ Slim
Returns a new instance of Slim.
12 13 14 15 16 17 18 |
# File 'lib/shattered_machine/slim.rb', line 12 def initialize( = {}) @colors = [:colors] || ALL_COLORS @direction = [:direction] || :vertical_inverted @probability = ([:probability] || 95).to_s @probability_area = [:probability_area] || 'global' @colors_with_proba = colors_with_proba([:colors_with_proba]) end |
Instance Method Details
#call(input_image, output_image) ⇒ boolean
Returns status of slim.
23 24 25 26 27 |
# File 'lib/shattered_machine/slim.rb', line 23 def call(input_image, output_image) RustyEngine.slim(input_image, output_image, @probability, @probability_area, rust_formatted_direction, rust_formatted_colors, rust_formatted_color_with_proba) end |