Class: PureJPEG::JFIFReader
- Inherits:
-
Object
- Object
- PureJPEG::JFIFReader
- Defined in:
- lib/pure_jpeg/jfif_reader.rb
Defined Under Namespace
Classes: Component, Scan, ScanComponent
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#huffman_tables ⇒ Object
readonly
Returns the value of attribute huffman_tables.
-
#icc_profile ⇒ Object
readonly
Returns the value of attribute icc_profile.
-
#progressive ⇒ Object
readonly
Returns the value of attribute progressive.
-
#quant_tables ⇒ Object
readonly
Returns the value of attribute quant_tables.
-
#restart_interval ⇒ Object
readonly
Returns the value of attribute restart_interval.
-
#scans ⇒ Object
readonly
Returns the value of attribute scans.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(data, stop_after_frame: false) ⇒ JFIFReader
constructor
A new instance of JFIFReader.
- #scan_components ⇒ Object
- #scan_data ⇒ Object
Constructor Details
#initialize(data, stop_after_frame: false) ⇒ JFIFReader
Returns a new instance of JFIFReader.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 12 def initialize(data, stop_after_frame: false) @data = data.b @stop_after_frame = stop_after_frame @pos = 0 @quant_tables = {} @huffman_tables = {} @components = [] @restart_interval = 0 @progressive = false @scans = [] @icc_chunks = {} parse assemble_icc_profile end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def components @components end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def height @height end |
#huffman_tables ⇒ Object (readonly)
Returns the value of attribute huffman_tables.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def huffman_tables @huffman_tables end |
#icc_profile ⇒ Object (readonly)
Returns the value of attribute icc_profile.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def icc_profile @icc_profile end |
#progressive ⇒ Object (readonly)
Returns the value of attribute progressive.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def progressive @progressive end |
#quant_tables ⇒ Object (readonly)
Returns the value of attribute quant_tables.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def quant_tables @quant_tables end |
#restart_interval ⇒ Object (readonly)
Returns the value of attribute restart_interval.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def restart_interval @restart_interval end |
#scans ⇒ Object (readonly)
Returns the value of attribute scans.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def scans @scans end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
5 6 7 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 5 def width @width end |
Instance Method Details
#scan_components ⇒ Object
27 28 29 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 27 def scan_components @scans.first&.components || [] end |
#scan_data ⇒ Object
31 32 33 |
# File 'lib/pure_jpeg/jfif_reader.rb', line 31 def scan_data @scans.first&.data || "".b end |