Class: JXL::Headers::FrameHeader
- Inherits:
-
Data
- Object
- Data
- JXL::Headers::FrameHeader
- Defined in:
- lib/jxl/headers/frame_header.rb
Instance Attribute Summary collapse
-
#b_qm_scale ⇒ Object
readonly
Returns the value of attribute b_qm_scale.
-
#blend ⇒ Object
readonly
Returns the value of attribute blend.
-
#chroma_subsampling ⇒ Object
readonly
Returns the value of attribute chroma_subsampling.
-
#colour_transform ⇒ Object
readonly
Returns the value of attribute colour_transform.
-
#dc_level ⇒ Object
readonly
Returns the value of attribute dc_level.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#encoding ⇒ Object
readonly
Returns the value of attribute encoding.
-
#extra_channel_blends ⇒ Object
readonly
Returns the value of attribute extra_channel_blends.
-
#extra_channel_upsampling ⇒ Object
readonly
Returns the value of attribute extra_channel_upsampling.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#group_size_shift ⇒ Object
readonly
Returns the value of attribute group_size_shift.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#last ⇒ Object
readonly
Returns the value of attribute last.
-
#loop_filter ⇒ Object
readonly
Returns the value of attribute loop_filter.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#origin_x ⇒ Object
readonly
Returns the value of attribute origin_x.
-
#origin_y ⇒ Object
readonly
Returns the value of attribute origin_y.
-
#passes ⇒ Object
readonly
Returns the value of attribute passes.
-
#save_as_reference ⇒ Object
readonly
Returns the value of attribute save_as_reference.
-
#save_before_colour_transform ⇒ Object
readonly
Returns the value of attribute save_before_colour_transform.
-
#timecode ⇒ Object
readonly
Returns the value of attribute timecode.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#upsampling ⇒ Object
readonly
Returns the value of attribute upsampling.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
-
#x_qm_scale ⇒ Object
readonly
Returns the value of attribute x_qm_scale.
Class Method Summary collapse
Instance Method Summary collapse
- #blocks_height ⇒ Object
- #blocks_width ⇒ Object
- #encoded_height ⇒ Object
- #encoded_width ⇒ Object
- #max_hshift ⇒ Object
- #max_vshift ⇒ Object
Instance Attribute Details
#b_qm_scale ⇒ Object (readonly)
Returns the value of attribute b_qm_scale
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def b_qm_scale @b_qm_scale end |
#blend ⇒ Object (readonly)
Returns the value of attribute blend
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def blend @blend end |
#chroma_subsampling ⇒ Object (readonly)
Returns the value of attribute chroma_subsampling
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def chroma_subsampling @chroma_subsampling end |
#colour_transform ⇒ Object (readonly)
Returns the value of attribute colour_transform
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def colour_transform @colour_transform end |
#dc_level ⇒ Object (readonly)
Returns the value of attribute dc_level
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def dc_level @dc_level end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def duration @duration end |
#encoding ⇒ Object (readonly)
Returns the value of attribute encoding
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def encoding @encoding end |
#extra_channel_blends ⇒ Object (readonly)
Returns the value of attribute extra_channel_blends
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def extra_channel_blends @extra_channel_blends end |
#extra_channel_upsampling ⇒ Object (readonly)
Returns the value of attribute extra_channel_upsampling
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def extra_channel_upsampling @extra_channel_upsampling end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def flags @flags end |
#group_size_shift ⇒ Object (readonly)
Returns the value of attribute group_size_shift
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def group_size_shift @group_size_shift end |
#height ⇒ Object (readonly)
Returns the value of attribute height
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def height @height end |
#last ⇒ Object (readonly)
Returns the value of attribute last
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def last @last end |
#loop_filter ⇒ Object (readonly)
Returns the value of attribute loop_filter
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def loop_filter @loop_filter end |
#name ⇒ Object (readonly)
Returns the value of attribute name
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def name @name end |
#origin_x ⇒ Object (readonly)
Returns the value of attribute origin_x
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def origin_x @origin_x end |
#origin_y ⇒ Object (readonly)
Returns the value of attribute origin_y
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def origin_y @origin_y end |
#passes ⇒ Object (readonly)
Returns the value of attribute passes
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def passes @passes end |
#save_as_reference ⇒ Object (readonly)
Returns the value of attribute save_as_reference
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def save_as_reference @save_as_reference end |
#save_before_colour_transform ⇒ Object (readonly)
Returns the value of attribute save_before_colour_transform
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def save_before_colour_transform @save_before_colour_transform end |
#timecode ⇒ Object (readonly)
Returns the value of attribute timecode
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def timecode @timecode end |
#type ⇒ Object (readonly)
Returns the value of attribute type
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def type @type end |
#upsampling ⇒ Object (readonly)
Returns the value of attribute upsampling
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def upsampling @upsampling end |
#width ⇒ Object (readonly)
Returns the value of attribute width
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def width @width end |
#x_qm_scale ⇒ Object (readonly)
Returns the value of attribute x_qm_scale
15 16 17 |
# File 'lib/jxl/headers/frame_header.rb', line 15 def x_qm_scale @x_qm_scale end |
Class Method Details
.read(reader, metadata:, image_width:, image_height:) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jxl/headers/frame_header.rb', line 27 def self.read(reader, metadata:, image_width:, image_height:) return defaults(, image_width, image_height) if Bit::Field.read_bool(reader) values = read_core(reader, ) read_geometry(reader, values, image_width, image_height) read_compositing(reader, values, , image_width, image_height) values[:name] = Bit::Field.string(reader) values[:loop_filter] = read_loop_filter(reader, values[:encoding]) Bit::Field.skip_extensions(reader) new(**values) end |
Instance Method Details
#blocks_height ⇒ Object
23 |
# File 'lib/jxl/headers/frame_header.rb', line 23 def blocks_height = Num.ceil_div(encoded_height, 8 << max_vshift) << max_vshift |
#blocks_width ⇒ Object
22 |
# File 'lib/jxl/headers/frame_header.rb', line 22 def blocks_width = Num.ceil_div(encoded_width, 8 << max_hshift) << max_hshift |
#encoded_height ⇒ Object
21 |
# File 'lib/jxl/headers/frame_header.rb', line 21 def encoded_height = Num.ceil_div(height, upsampling << (3 * dc_level)) |
#encoded_width ⇒ Object
20 |
# File 'lib/jxl/headers/frame_header.rb', line 20 def encoded_width = Num.ceil_div(width, upsampling << (3 * dc_level)) |
#max_hshift ⇒ Object
24 |
# File 'lib/jxl/headers/frame_header.rb', line 24 def max_hshift = chroma_subsampling.map(&:first).max |
#max_vshift ⇒ Object
25 |
# File 'lib/jxl/headers/frame_header.rb', line 25 def max_vshift = chroma_subsampling.map(&:last).max |