Class: JXL::Modular::GroupHeader

Inherits:
Data
  • Object
show all
Defined in:
lib/jxl/modular/group_header.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#transformsObject (readonly)

Returns the value of attribute transforms

Returns:

  • (Object)

    the current value of transforms



9
10
11
# File 'lib/jxl/modular/group_header.rb', line 9

def transforms
  @transforms
end

#use_global_treeObject (readonly)

Returns the value of attribute use_global_tree

Returns:

  • (Object)

    the current value of use_global_tree



9
10
11
# File 'lib/jxl/modular/group_header.rb', line 9

def use_global_tree
  @use_global_tree
end

#weightedObject (readonly)

Returns the value of attribute weighted

Returns:

  • (Object)

    the current value of weighted



9
10
11
# File 'lib/jxl/modular/group_header.rb', line 9

def weighted
  @weighted
end

Class Method Details

.read(reader) ⇒ Object

Raises:



10
11
12
13
14
15
16
17
18
19
# File 'lib/jxl/modular/group_header.rb', line 10

def self.read(reader)
  use_global_tree = Bit::Field.read_bool(reader)
  weighted = read_weighted(reader)
  count = Bit::Field.u32(reader, Bit::Field.val(0), Bit::Field.val(1),
                         Bit::Field.bits_offset(4, 2), Bit::Field.bits_offset(8, 18))
  raise ResourceLimitError, "too many modular transforms" if count > 256

  transforms = Array.new(count) { read_transform(reader) }
  new(use_global_tree:, weighted:, transforms:)
end