Parent

QRTools::Image

Constants

Point
(Not documented)

Public Instance Methods

draw_line(options) click to toggle source

Draw a line on this image:

  draw_line :from => 0, :to => 100, :thickness => 5
# File lib/qrtools/image.rb, line 11
    def draw_line options
      raise ArgumentError unless options.key?(:from)
      raise ArgumentError unless options.key?(:to)
      options = {
        :r => 255,
        :g => 0,
        :b => 0,
        :thickness => 1,
        :type => 8,
        :shift => 0,
      }.merge(options)
      native_draw_line(
        options[:from],
        options[:to],
        options[:r],
        options[:g],
        options[:b],
        options[:thickness],
        options[:type],
        options[:shift]
      )
    end
native_draw_line(from, to, r, g, b, thickness, type, shift)
click to toggle source

Draw line from from vertex to to vertex

static VALUE native_draw_line(
    VALUE self,
    VALUE _from,
    VALUE _to,
    VALUE _r,
    VALUE _g,
    VALUE _b,
    VALUE _thickness,
    VALUE _type,
    VALUE _shift
) 
to_nsimage() click to toggle source

Convert this Image to an OSX::NSImage

# File lib/qrtools/image.rb, line 36
    def to_nsimage
      require 'osx/cocoa'
      filename = File.join(Dir::tmpdir, 'out.jpg')
      save(filename)
      OSX::NSImage.alloc.initWithContentsOfFile filename
    end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.