Class: Morandi::Gamma
Instance Attribute Summary collapse
-
#gamma ⇒ Object
readonly
Returns the value of attribute gamma.
Instance Method Summary collapse
- #call(image, pixbuf) ⇒ Object
-
#initialize(gamma = 1.0) ⇒ Gamma
constructor
A new instance of Gamma.
- #priority ⇒ Object
Methods inherited from ImageOp
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
#gamma ⇒ Object (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 |
#priority ⇒ Object
261 262 263 |
# File 'lib/morandi/image-ops.rb', line 261 def priority 90 end |