Class: JXL::Headers::FrameHeader

Inherits:
Data
  • Object
show all
Defined in:
lib/jxl/headers/frame_header.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#b_qm_scaleObject (readonly)

Returns the value of attribute b_qm_scale

Returns:

  • (Object)

    the current value of b_qm_scale



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def b_qm_scale
  @b_qm_scale
end

#blendObject (readonly)

Returns the value of attribute blend

Returns:

  • (Object)

    the current value of blend



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def blend
  @blend
end

#chroma_subsamplingObject (readonly)

Returns the value of attribute chroma_subsampling

Returns:

  • (Object)

    the current value of chroma_subsampling



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def chroma_subsampling
  @chroma_subsampling
end

#colour_transformObject (readonly)

Returns the value of attribute colour_transform

Returns:

  • (Object)

    the current value of colour_transform



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def colour_transform
  @colour_transform
end

#dc_levelObject (readonly)

Returns the value of attribute dc_level

Returns:

  • (Object)

    the current value of dc_level



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def dc_level
  @dc_level
end

#durationObject (readonly)

Returns the value of attribute duration

Returns:

  • (Object)

    the current value of duration



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def duration
  @duration
end

#encodingObject (readonly)

Returns the value of attribute encoding

Returns:

  • (Object)

    the current value of encoding



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def encoding
  @encoding
end

#extra_channel_blendsObject (readonly)

Returns the value of attribute extra_channel_blends

Returns:

  • (Object)

    the current value of 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_upsamplingObject (readonly)

Returns the value of attribute extra_channel_upsampling

Returns:

  • (Object)

    the current value of extra_channel_upsampling



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def extra_channel_upsampling
  @extra_channel_upsampling
end

#flagsObject (readonly)

Returns the value of attribute flags

Returns:

  • (Object)

    the current value of flags



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def flags
  @flags
end

#group_size_shiftObject (readonly)

Returns the value of attribute group_size_shift

Returns:

  • (Object)

    the current value of group_size_shift



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def group_size_shift
  @group_size_shift
end

#heightObject (readonly)

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def height
  @height
end

#lastObject (readonly)

Returns the value of attribute last

Returns:

  • (Object)

    the current value of last



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def last
  @last
end

#loop_filterObject (readonly)

Returns the value of attribute loop_filter

Returns:

  • (Object)

    the current value of loop_filter



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def loop_filter
  @loop_filter
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def name
  @name
end

#origin_xObject (readonly)

Returns the value of attribute origin_x

Returns:

  • (Object)

    the current value of origin_x



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def origin_x
  @origin_x
end

#origin_yObject (readonly)

Returns the value of attribute origin_y

Returns:

  • (Object)

    the current value of origin_y



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def origin_y
  @origin_y
end

#passesObject (readonly)

Returns the value of attribute passes

Returns:

  • (Object)

    the current value of passes



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def passes
  @passes
end

#save_as_referenceObject (readonly)

Returns the value of attribute save_as_reference

Returns:

  • (Object)

    the current value of 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_transformObject (readonly)

Returns the value of attribute save_before_colour_transform

Returns:

  • (Object)

    the current value of 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

#timecodeObject (readonly)

Returns the value of attribute timecode

Returns:

  • (Object)

    the current value of timecode



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def timecode
  @timecode
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def type
  @type
end

#upsamplingObject (readonly)

Returns the value of attribute upsampling

Returns:

  • (Object)

    the current value of upsampling



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def upsampling
  @upsampling
end

#widthObject (readonly)

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



15
16
17
# File 'lib/jxl/headers/frame_header.rb', line 15

def width
  @width
end

#x_qm_scaleObject (readonly)

Returns the value of attribute x_qm_scale

Returns:

  • (Object)

    the current value of 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_heightObject



23
# File 'lib/jxl/headers/frame_header.rb', line 23

def blocks_height = Num.ceil_div(encoded_height, 8 << max_vshift) << max_vshift

#blocks_widthObject



22
# File 'lib/jxl/headers/frame_header.rb', line 22

def blocks_width = Num.ceil_div(encoded_width, 8 << max_hshift) << max_hshift

#encoded_heightObject



21
# File 'lib/jxl/headers/frame_header.rb', line 21

def encoded_height = Num.ceil_div(height, upsampling << (3 * dc_level))

#encoded_widthObject



20
# File 'lib/jxl/headers/frame_header.rb', line 20

def encoded_width = Num.ceil_div(width, upsampling << (3 * dc_level))

#max_hshiftObject



24
# File 'lib/jxl/headers/frame_header.rb', line 24

def max_hshift = chroma_subsampling.map(&:first).max

#max_vshiftObject



25
# File 'lib/jxl/headers/frame_header.rb', line 25

def max_vshift = chroma_subsampling.map(&:last).max