code: def parse(cls, fptr, offset, length):
          
          num_bytes = offset + length - fptr.tell()
          num_components = int(num_bytes / 4)
  
          read_buffer = fptr.read(num_bytes)
          data = struct.unpack('>' + 'HBB' * num_components, read_buffer)
  
          component_index = data[0:num_bytes:3]
          mapping_type = data[1:num_bytes:3]
          palette_index = data[2:num_bytes:3]
  
          return cls(component_index, mapping_type, palette_index,
                     length=length, offset=offset)
docs: Parse component mapping box.
  
          Parameters
          ----------
          fptr : file
              Open file object.
          offset : int
              Start position of box in bytes.
          length : int
              Length of the box in bytes.
  
          Returns
          -------
          ComponentMappingBox
              Instance of the current component mapping box.