class Morandi::Colourify
Attributes
op[R]
Public Class Methods
new(op, alpha=255)
click to toggle source
Calls superclass method
Morandi::ImageOp::new
# File lib/morandi/image-ops.rb, line 269 def initialize(op, alpha=255) super() @op = op @alpha = alpha end
Public Instance Methods
alpha()
click to toggle source
# File lib/morandi/image-ops.rb, line 275 def alpha @alpha || 255 end
bluetone(pixbuf)
click to toggle source
# File lib/morandi/image-ops.rb, line 283 def bluetone(pixbuf) PixbufUtils.tint(pixbuf, -10, 5, 25, alpha) end
call(image, pixbuf)
click to toggle source
# File lib/morandi/image-ops.rb, line 298 def call(image, pixbuf) if @op and respond_to?(@op) __send__(@op, pixbuf) else pixbuf # Default is nothing end end
greyscale(pixbuf)
click to toggle source
# File lib/morandi/image-ops.rb, line 293 def greyscale(pixbuf) PixbufUtils.tint(pixbuf, 0, 0, 0, alpha) end
Also aliased as: bw
null(pixbuf)
click to toggle source
# File lib/morandi/image-ops.rb, line 287 def null(pixbuf) pixbuf end
sepia(pixbuf)
click to toggle source
# File lib/morandi/image-ops.rb, line 279 def sepia(pixbuf) PixbufUtils.tint(pixbuf, 25, 5, -25, alpha) end