Class: VIPS::PNGWriter
- Defined in:
- lib/vips/writer.rb,
ext/writer.c
Instance Attribute Summary collapse
-
#compression ⇒ Object
Returns the value of attribute compression.
-
#interlace ⇒ Object
Returns the value of attribute interlace.
Instance Method Summary collapse
-
#initialize(image, options = {}) ⇒ PNGWriter
constructor
A new instance of PNGWriter.
- #to_memory ⇒ Object
- #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, #sizeof_element, #sizeof_line, #sizeof_pel, #x_offset, #x_res, #x_size, #y_offset, #y_res, #y_size
Constructor Details
#initialize(image, options = {}) ⇒ PNGWriter
Returns a new instance of PNGWriter.
55 56 57 58 59 60 61 62 63 |
# File 'lib/vips/writer.rb', line 55 def initialize(image, ={}) super image @compression = 6 @interlace = false self.compression = [:compression] if .has_key?(:compression) self.interlace = [:interlace] if .has_key?(:interlace) end |
Instance Attribute Details
#compression ⇒ Object
Returns the value of attribute compression.
52 53 54 |
# File 'lib/vips/writer.rb', line 52 def compression @compression end |
#interlace ⇒ Object
Returns the value of attribute interlace.
53 54 55 |
# File 'lib/vips/writer.rb', line 53 def interlace @interlace end |
Instance Method Details
#to_memory ⇒ Object
69 70 71 |
# File 'lib/vips/writer.rb', line 69 def to_memory buf_internal @compression, (@interlace ? 1 : 0) end |
#write(path) ⇒ Object
65 66 67 |
# File 'lib/vips/writer.rb', line 65 def write(path) write_internal "#{path}:#{@compression},#{@interlace ? 1 : 0}" end |