Class: VIPS::WEBPWriter

Inherits:
Writer
  • Object
show all
Defined in:
lib/vips/writer.rb,
ext/writer.c

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options={})
  super image

  @quality = 75
  @lossless = false

  self.quality = options[:quality] if options.has_key?(:quality)
  self.lossless = options[:lossless] if options.has_key?(:lossless)
end

Instance Attribute Details

#losslessObject

Returns the value of attribute lossless.



116
117
118
# File 'lib/vips/writer.rb', line 116

def lossless
  @lossless
end

#qualityObject

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