glymur/jp2box.py
def parse(cls, fptr, offset, length):
        """Parse component definition box.

        Parameters
        ----------
        fptr : file
            Open file object.
        offset : int
            Start position of box in bytes.
        length : int
            Length of the box in bytes.

        Returns
        -------
        ComponentDefinitionBox
            Instance of the current component definition box.
        """
        num_bytes = offset + length - fptr.tell()
        read_buffer = fptr.read(num_bytes)

        # Read the number of components.
        num_components, = struct.unpack_from('>H', read_buffer)

        data = struct.unpack_from('>' + 'HHH' * num_components, read_buffer,
                                  offset=2)
        index = data[0:num_components * 6:3]
        channel_type = data[1:num_components * 6:3]
        association = data[2:num_components * 6:3]

        return cls(index=tuple(index),
                   channel_type=tuple(channel_type),
                   association=tuple(association),
                   length=length, offset=offset)
Parse component definition box.

        Parameters
        ----------
        fptr : file
            Open file object.
        offset : int
            Start position of box in bytes.
        length : int
            Length of the box in bytes.

        Returns
        -------
        ComponentDefinitionBox
            Instance of the current component definition box.
        
Parse component definition box.
Parameters

fptr : file
Open file object.
offset : int
Start position of box in bytes.
length : int
Length of the box in bytes.

Returns

ComponentDefinitionBox
Instance of the current component definition box.
Parse component definition box . Parameters fptr : file Open file object . offset : int Start position of box in bytes . length : int Length of the box in bytes . Returns ComponentDefinitionBox Instance of the current component definition box .
def parse(cls, fptr, offset, length):
        num_bytes = offset + length - fptr.tell()
        read_buffer = fptr.read(num_bytes)
        num_components, = struct.unpack_from('>H', read_buffer)
        data = struct.unpack_from('>' + 'HHH' * num_components, read_buffer,
                                  offset=2)
        index = data[0:num_components * 6:3]
        channel_type = data[1:num_components * 6:3]
        association = data[2:num_components * 6:3]
        return cls(index=tuple(index),
                   channel_type=tuple(channel_type),
                   association=tuple(association),
                   length=length, offset=offset)
def parse ( cls , fptr , offset , length ) : num_bytes = offset + length - fptr . tell ( ) read_buffer = fptr . read ( num_bytes ) num_components , = struct . unpack_from ( '>H' , read_buffer ) data = struct . unpack_from ( '>' + 'HHH' * num_components , read_buffer , offset = 2 ) index = data [ 0 : num_components * 6 : 3 ] channel_type = data [ 1 : num_components * 6 : 3 ] association = data [ 2 : num_components * 6 : 3 ] return cls ( index = tuple ( index ) , channel_type = tuple ( channel_type ) , association = tuple ( association ) , length = length , offset = offset )
Parse component definition box.
Parse component definition box .
"""Parse component definition box.

        Parameters
        ----------
        fptr : file
            Open file object.
        offset : int
            Start position of box in bytes.
        length : int
            Length of the box in bytes.

        Returns
        -------
        ComponentDefinitionBox
            Instance of the current component definition box.
        """ # Read the number of components.
cls
fptr
offset
length