@classmethod<EOL><INDENT>def parse(cls, fptr, offset, length):<DEDENT>
num_bytes = offset + length - fptr.tell()<EOL>num_components = int(num_bytes / <NUM_LIT:4>)<EOL>read_buffer = fptr.read(num_bytes)<EOL>data = struct.unpack('<STR_LIT:>>' + '<STR_LIT>' * num_components, read_buffer)<EOL>component_index = data[<NUM_LIT:0>:num_bytes:<NUM_LIT:3>]<EOL>mapping_type = data[<NUM_LIT:1>:num_bytes:<NUM_LIT:3>]<EOL>palette_index = data[<NUM_LIT:2>:num_bytes:<NUM_LIT:3>]<EOL>return cls(component_index, mapping_type, palette_index,<EOL>length=length, offset=offset)<EOL>
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.