Class: ZIMG::JPEG::SOS
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
-
#ecs ⇒ Object
Returns the value of attribute ecs.
-
#ncomp ⇒ Object
Returns the value of attribute ncomp.
-
#spectral_end ⇒ Object
Returns the value of attribute spectral_end.
-
#spectral_start ⇒ Object
Returns the value of attribute spectral_start.
-
#successive_approx ⇒ Object
Returns the value of attribute successive_approx.
Attributes inherited from Chunk
Instance Method Summary collapse
-
#initialize(marker, io) ⇒ SOS
constructor
A new instance of SOS.
- #inspect(*args) ⇒ Object
Methods inherited from Chunk
Methods inherited from Chunk
Constructor Details
#initialize(marker, io) ⇒ SOS
Returns a new instance of SOS.
250 251 252 253 254 255 256 257 258 259 |
# File 'lib/zimg/jpeg/chunks.rb', line 250 def initialize(marker, io) super sio = StringIO.new(@data) @ncomp = sio.read(1).ord @components = [] @ncomp.times do @components << [sio.read(1).ord, sio.read(1).ord] end @spectral_start, @spectral_end, @successive_approx = sio.read(3).unpack("C3") end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
248 249 250 |
# File 'lib/zimg/jpeg/chunks.rb', line 248 def components @components end |
#ecs ⇒ Object
Returns the value of attribute ecs.
248 249 250 |
# File 'lib/zimg/jpeg/chunks.rb', line 248 def ecs @ecs end |
#ncomp ⇒ Object
Returns the value of attribute ncomp.
248 249 250 |
# File 'lib/zimg/jpeg/chunks.rb', line 248 def ncomp @ncomp end |
#spectral_end ⇒ Object
Returns the value of attribute spectral_end.
248 249 250 |
# File 'lib/zimg/jpeg/chunks.rb', line 248 def spectral_end @spectral_end end |
#spectral_start ⇒ Object
Returns the value of attribute spectral_start.
248 249 250 |
# File 'lib/zimg/jpeg/chunks.rb', line 248 def spectral_start @spectral_start end |
#successive_approx ⇒ Object
Returns the value of attribute successive_approx.
248 249 250 |
# File 'lib/zimg/jpeg/chunks.rb', line 248 def successive_approx @successive_approx end |
Instance Method Details
#inspect(*args) ⇒ Object
261 262 263 264 |
# File 'lib/zimg/jpeg/chunks.rb', line 261 def inspect *args super.chop + format("ncomp=%d components=%s spectral=%d..%d successive_approx=%d>", ncomp, components.inspect, spectral_start, spectral_end, successive_approx) end |