Class: Quartz::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyquartz/image.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Image

Returns a new instance of Image.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rubyquartz/image.rb', line 29

def initialize(options)
  bitmap_context = options[:bitmap_context]
  if bitmap_context
    _initialize_with_bitmap_context(bitmap_context)
    return
  end

  image_source = options[:image_source]
  index = options[:index]
  if image_source && index
    _initialize_with_image_source_at_index(image_source, index)
    return
  end
  
  # TODO: Add various other creation types
  raise "Cannot determine how to create image from given options"
end