Class: Morandi::Gamma

Inherits:
ImageOp show all
Defined in:
lib/morandi/image-ops.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ImageOp

new_from_hash

Constructor Details

#initialize(gamma = 1.0) ⇒ Gamma

Returns a new instance of Gamma.



250
251
252
253
# File 'lib/morandi/image-ops.rb', line 250

def initialize(gamma=1.0)
  super()
  @gamma = gamma
end

Instance Attribute Details

#gammaObject (readonly)

Returns the value of attribute gamma.



249
250
251
# File 'lib/morandi/image-ops.rb', line 249

def gamma
  @gamma
end

Instance Method Details

#call(image, pixbuf) ⇒ Object



254
255
256
257
258
259
260
# File 'lib/morandi/image-ops.rb', line 254

def call(image, pixbuf)
  if @gamma == 1.0
    pixbuf
  else
    PixbufUtils.gamma(pixbuf, @gamma)
  end
end

#priorityObject



261
262
263
# File 'lib/morandi/image-ops.rb', line 261

def priority
  90
end