Class: VIPS::WEBPWriter
- Defined in:
- lib/vips/writer.rb,
ext/writer.c
Instance Attribute Summary collapse
-
#lossless ⇒ Object
Returns the value of attribute lossless.
-
#quality ⇒ Object
Returns the value of attribute quality.
Instance Method Summary collapse
-
#initialize(image, options = {}) ⇒ WEBPWriter
constructor
A new instance of WEBPWriter.
- #write(path) ⇒ Object
Methods inherited from Writer
#exif=, #icc=, #image, #remove_exif, #remove_icc
Methods included from Header
#band_fmt, #bands, #exif, #exif?, #get, #icc, #icc?, #n_elements, #set, #size, #sizeof_element, #sizeof_line, #sizeof_pel, #x_offset, #x_res, #x_size, #y_offset, #y_res, #y_size
Constructor Details
#initialize(image, options = {}) ⇒ WEBPWriter
Returns a new instance of WEBPWriter.
118 119 120 121 122 123 124 125 126 |
# File 'lib/vips/writer.rb', line 118 def initialize(image, ={}) super image @quality = 75 @lossless = false self.quality = [:quality] if .has_key?(:quality) self.lossless = [:lossless] if .has_key?(:lossless) end |
Instance Attribute Details
#lossless ⇒ Object
Returns the value of attribute lossless.
116 117 118 |
# File 'lib/vips/writer.rb', line 116 def lossless @lossless end |
#quality ⇒ Object
Returns the value of attribute quality.
116 117 118 |
# File 'lib/vips/writer.rb', line 116 def quality @quality end |
Instance Method Details
#write(path) ⇒ Object
128 129 130 |
# File 'lib/vips/writer.rb', line 128 def write(path) write_gc "#{path}:#{@quality},#{@lossless ? 1 : 0}" end |