class Morandi::Rotate

Attributes

angle[RW]

Public Class Methods

new(angle=0) click to toggle source
Calls superclass method Morandi::ImageOp::new
# File lib/morandi/image-ops.rb, line 48
def initialize(angle=0)
  super()
  @angle = angle
end

Public Instance Methods

call(image, pixbuf) click to toggle source
# File lib/morandi/image-ops.rb, line 52
def call(image, pixbuf)
  if @angle.zero?
    pixbuf
  else
    case @angle
    when 0, 90, 180, 270
      PixbufUtils::rotate(pixbuf, @angle)
    else
      raise "Not a valid angle"
    end
  end
end