Class: Axon::JPEGWriter
- Inherits:
-
Object
- Object
- Axon::JPEGWriter
- Includes:
- JPEGNativeWriter
- Defined in:
- lib/axon/jpeg_writer.rb
Instance Attribute Summary collapse
-
#bufsize ⇒ Object
readonly
Returns the value of attribute bufsize.
-
#exif ⇒ Object
Returns the value of attribute exif.
-
#icc_profile ⇒ Object
Returns the value of attribute icc_profile.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#io ⇒ Object
readonly
Returns the value of attribute io.
-
#quality ⇒ Object
Returns the value of attribute quality.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(image) ⇒ JPEGWriter
constructor
A new instance of JPEGWriter.
- #write(io, bufsize = nil) ⇒ Object
Methods included from JPEGNativeWriter
Constructor Details
#initialize(image) ⇒ JPEGWriter
Returns a new instance of JPEGWriter.
10 11 12 13 14 15 |
# File 'lib/axon/jpeg_writer.rb', line 10 def initialize(image) @image = image @quality = nil @icc_profile = nil @exif = nil end |
Instance Attribute Details
#bufsize ⇒ Object (readonly)
Returns the value of attribute bufsize.
8 9 10 |
# File 'lib/axon/jpeg_writer.rb', line 8 def bufsize @bufsize end |
#exif ⇒ Object
Returns the value of attribute exif.
7 8 9 |
# File 'lib/axon/jpeg_writer.rb', line 7 def exif @exif end |
#icc_profile ⇒ Object
Returns the value of attribute icc_profile.
7 8 9 |
# File 'lib/axon/jpeg_writer.rb', line 7 def icc_profile @icc_profile end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
8 9 10 |
# File 'lib/axon/jpeg_writer.rb', line 8 def image @image end |
#io ⇒ Object (readonly)
Returns the value of attribute io.
8 9 10 |
# File 'lib/axon/jpeg_writer.rb', line 8 def io @io end |
#quality ⇒ Object
Returns the value of attribute quality.
7 8 9 |
# File 'lib/axon/jpeg_writer.rb', line 7 def quality @quality end |
Instance Method Details
#data ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/axon/jpeg_writer.rb', line 23 def data s = StringIO.new s.set_encoding 'BINARY' if s.respond_to?(:set_encoding) write(s) s.string end |
#write(io, bufsize = nil) ⇒ Object
17 18 19 20 21 |
# File 'lib/axon/jpeg_writer.rb', line 17 def write(io, bufsize = nil) @bufsize = bufsize || 512 @io = io jpeg_native_write end |