class Image

Attributes

channels[R]
data[R]
height[R]
width[R]

Public Class Methods

new(path) click to toggle source
# File lib/image.rb, line 7
def initialize(path)
  @data = read(path)
end

Public Instance Methods

read(path) click to toggle source
# File lib/image.rb, line 11
def read(path)
  is_bmp = 1
  if(is_bmp)
    bmp_instance = Bmp.new(path)

    a = bmp_instance.read_to_array
    bmp_instance.describe
    @height = bmp_instance.height
    @width = bmp_instance.width
    #@channels = a[0][0].length
  end
  a
end
write(path) click to toggle source
# File lib/image.rb, line 25
def write(path)
  is_bmp = true
  if(is_bmp)
    a = Bmp.write_to_bmp(path,@data,8,0)
  end
end