Class: Axon::PNGWriter
- Inherits:
-
Object
- Object
- Axon::PNGWriter
- Includes:
- PNGNativeWriter
- Defined in:
- lib/axon/png_writer.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(image) ⇒ PNGWriter
constructor
A new instance of PNGWriter.
- #write(io) ⇒ Object
Methods included from PNGNativeWriter
Constructor Details
#initialize(image) ⇒ PNGWriter
Returns a new instance of PNGWriter.
9 10 11 |
# File 'lib/axon/png_writer.rb', line 9 def initialize(image) @image = image end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
7 8 9 |
# File 'lib/axon/png_writer.rb', line 7 def image @image end |
Instance Method Details
#data ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/axon/png_writer.rb', line 17 def data s = StringIO.new s.set_encoding 'BINARY' if s.respond_to?(:set_encoding) write(s) s.string end |
#write(io) ⇒ Object
13 14 15 |
# File 'lib/axon/png_writer.rb', line 13 def write(io) png_native_write(io) end |