def read_tile_header(codec, stream):
ARGTYPES = [CODEC_TYPE,<EOL>STREAM_TYPE_P,<EOL>ctypes.POINTER(ctypes.c_uint32),<EOL>ctypes.POINTER(ctypes.c_uint32),<EOL>ctypes.POINTER(ctypes.c_int32),<EOL>ctypes.POINTER(ctypes.c_int32),<EOL>ctypes.POINTER(ctypes.c_int32),<EOL>ctypes.POINTER(ctypes.c_int32),<EOL>ctypes.POINTER(ctypes.c_uint32),<EOL>ctypes.POINTER(BOOL_TYPE)]<EOL>OPENJP2.opj_read_tile_header.argtypes = ARGTYPES<EOL>OPENJP2.opj_read_tile_header.restype = check_error<EOL>tile_index = ctypes.c_uint32()<EOL>data_size = ctypes.c_uint32()<EOL>col0 = ctypes.c_int32()<EOL>row0 = ctypes.c_int32()<EOL>col1 = ctypes.c_int32()<EOL>row1 = ctypes.c_int32()<EOL>ncomps = ctypes.c_uint32()<EOL>go_on = BOOL_TYPE()<EOL>OPENJP2.opj_read_tile_header(codec,<EOL>stream,<EOL>ctypes.byref(tile_index),<EOL>ctypes.byref(data_size),<EOL>ctypes.byref(col0),<EOL>ctypes.byref(row0),<EOL>ctypes.byref(col1),<EOL>ctypes.byref(row1),<EOL>ctypes.byref(ncomps),<EOL>ctypes.byref(go_on))<EOL>go_on = bool(go_on.value)<EOL>return (tile_index.value,<EOL>data_size.value,<EOL>col0.value,<EOL>row0.value,<EOL>col1.value,<EOL>row1.value,<EOL>ncomps.value,<EOL>go_on)<EOL>
Reads a tile header.

    Wraps the openjp2 library function opj_read_tile_header.

    Parameters
    ----------
    codec : codec_t
        The JPEG2000 codec to read.
    stream : STREAM_TYPE_P
        The JPEG2000 stream.

    Returns
    -------
    tile_index : int
        index of the tile being decoded
    data_size : int
        number of bytes for the decoded area
    x0, y0 : int
        upper left-most coordinate of tile
    x1, y1 : int
        lower right-most coordinate of tile
    ncomps : int
        number of components in the tile
    go_on : bool
        indicates that decoding should continue

    Raises
    ------
    RuntimeError
        If the OpenJPEG library routine opj_read_tile_header fails.