Sha256: 60e3056b6669639e07013b75fdda3c2c637b11289252b5aa7d9824744853bb69

Contents?: true

Size: 465 Bytes

Versions: 1

Compression:

Stored size: 465 Bytes

Contents

module ChunkyPNG
  class Image
    
    attr_reader :pixels
    
    def initialize(width, height, background_color = ChunkyPNG::Pixel::TRANSPARENT)
      @pixels = ChunkyPNG::PixelMatrix.new(width, height, background_color)
    end
    
    def width
      pixels.width
    end
    
    def height
      pixels.height
    end
    
    def write(io, constraints = {})
      datastream = pixels.to_datastream(constraints)
      datastream.write(io)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chunky_png-0.0.2 lib/chunky_png/image.rb