Class: TRMNLP::ScreenGenerator
- Inherits:
-
Object
- Object
- TRMNLP::ScreenGenerator
- Defined in:
- lib/trmnlp/screen_generator.rb
Instance Method Summary collapse
-
#initialize(html, opts = {}) ⇒ ScreenGenerator
constructor
A new instance of ScreenGenerator.
- #process ⇒ Object
Constructor Details
#initialize(html, opts = {}) ⇒ ScreenGenerator
Returns a new instance of ScreenGenerator.
8 9 10 11 12 13 14 |
# File 'lib/trmnlp/screen_generator.rb', line 8 def initialize(html, opts = {}) @input = html @screenshot = opts[:screenshot] @requested_width = opts[:width] @requested_height = opts[:height] @requested_color_depth = opts[:color_depth] end |
Instance Method Details
#process ⇒ Object
16 17 18 19 20 |
# File 'lib/trmnlp/screen_generator.rb', line 16 def process output = @screenshot.call(html: @input, width:, height:) ImageQuantizer.new(depth: color_depth).call(output.path) output end |