Class: SmartImage::BaseCanvas
- Inherits:
-
Object
- Object
- SmartImage::BaseCanvas
- 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
Instance Method Summary collapse
-
#alpha_mask(image_data, options = {}) ⇒ Object
Load the given file as an alpha mask for the image.
-
#composite(image_data, width, height, options = {}) ⇒ Object
Composite another image onto this canvas.
-
#destroy ⇒ Object
Destroy the canvas (if you need to).
-
#destroyed? ⇒ Boolean
Has the canvas been destroyed already?.
-
#encode(format, options = {}) ⇒ Object
Encode the image to the given format.
-
#initialize(width, height) ⇒ BaseCanvas
constructor
Create a new canvas object of the given width and height.
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, = {}) 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, = {}) not_implemented :composite end |
#destroy ⇒ Object
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?
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, = {}) not_implemented :encode end |