Class: ImgToScript::Generators::Generator

Inherits:
Object
  • Object
show all
Includes:
Dry::Configurable
Defined in:
lib/img_to_script/generators/generator.rb

Overview

Base class.

Instance Method Summary collapse

Instance Method Details

#generate(image:, scr_width:, scr_height:) ⇒ Array<AbstractToken>

Generate abstract tokens that represent the image.

Parameters:

  • image (Magick::BinMagick::Image)

    Binary image.

  • scr_width (Integer)

    Target device horizontal screen resolution.

  • scr_height (Integer)

    Target device vertical screen resolution.

Returns:



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/img_to_script/generators/generator.rb', line 33

def generate(image:, scr_width:, scr_height:)
  @image = image
  @scr_width = scr_width
  @scr_height = scr_height
  @x_offset = config.x_offset
  @y_offset = config.y_offset

  _generate_tokens

  @tokens
end