Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.81 KB | None | 0 0
  1. #coding: utf-8
  2. class HumanScriptMethod
  3.   @@default_params={}
  4.  
  5.   def initialize(source, last_result, params={})
  6.     @params=(@@default_params||{}).merge(params)
  7.     @source, @last_result = source, last_result
  8.   end
  9.  
  10.  
  11.  
  12. end
  13.  
  14. #coding: utf-8
  15. class HumanScriptMethodGrayscale < HumanScriptMethod
  16.  
  17.   def initialize(source, last_result, params=nil)
  18.     super
  19.   end
  20.  
  21.  
  22.   def do_your_work
  23.     log "paramsG"
  24.     log @params
  25.     @last_result.quantize(256,Magick::GRAYColorspace)
  26.   end
  27. end
  28.  
  29. class HumanScriptMethodComplex < HumanScriptMethod
  30.   @@default_params={:split_size=>5, :contrast_filter=>0.1, :color=>Magick::Pixel.from_color("white")}
  31.  
  32.   def initialize(source, last_result, params={})
  33.     super
  34.   end
  35.  
  36.   def do_your_work
  37.     #тут много кода, не суть
  38.     @last_result
  39.   end
  40.  
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement