Class: SmartImage::BaseCanvas

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_image/base_canvas.rb

Overview

This class defines the set of methods all canvases are expected to implement It also documents the set of methods that should be available for a canvas

Direct Known Subclasses

JavaCanvas, RMagickCanvas

Instance Method Summary collapse

Constructor Details

#initialize(width, height) ⇒ BaseCanvas

Create a new canvas object of the given width and height



9
10
11
# File 'lib/smart_image/base_canvas.rb', line 9

def initialize(width, height)
  raise NotImplementedError, "some silly person forgot to define a constructor"
end

Instance Method Details

#alpha_mask(image_data, options = {}) ⇒ Object

Load the given file as an alpha mask for the image



29
30
31
# File 'lib/smart_image/base_canvas.rb', line 29

def alpha_mask(image_data, options = {})
  not_implemented :alpha_mask
end

#composite(image_data, width, height, options = {}) ⇒ Object

Composite another image onto this canvas



24
25
26
# File 'lib/smart_image/base_canvas.rb', line 24

def composite(image_data, width, height, options = {})
  not_implemented :composite
end

#destroyObject

Destroy the canvas (if you need to)



14
15
16
# File 'lib/smart_image/base_canvas.rb', line 14

def destroy
  not_implemented :destroy
end

#destroyed?Boolean

Has the canvas been destroyed already?

Returns:

  • (Boolean)


19
20
21
# File 'lib/smart_image/base_canvas.rb', line 19

def destroyed?
  not_implemented :destroyed?
end

#encode(format, options = {}) ⇒ Object

Encode the image to the given format



34
35
36
# File 'lib/smart_image/base_canvas.rb', line 34

def encode(format, options = {})
  not_implemented :encode
end