Class: Borealis::ImageConverter
- Inherits:
-
Object
- Object
- Borealis::ImageConverter
- Defined in:
- lib/borealis/image_converter.rb
Instance Method Summary collapse
-
#initialize(image, size) ⇒ ImageConverter
constructor
A new instance of ImageConverter.
- #read_image ⇒ Object
- #to_colors ⇒ Object
Constructor Details
#initialize(image, size) ⇒ ImageConverter
Returns a new instance of ImageConverter.
5 6 7 8 |
# File 'lib/borealis/image_converter.rb', line 5 def initialize(image, size) @image = image @size = size || '50x50' end |
Instance Method Details
#read_image ⇒ Object
10 11 12 13 14 15 |
# File 'lib/borealis/image_converter.rb', line 10 def read_image Cocaine::CommandLine.new( 'convert', "#{@image} -resize #{@size} txt:-" ).run end |
#to_colors ⇒ Object
17 18 19 |
# File 'lib/borealis/image_converter.rb', line 17 def to_colors colors_for(read_image) end |