def end_compress(codec, stream):
OPENJP2.opj_end_compress.argtypes = [CODEC_TYPE, STREAM_TYPE_P]<EOL>OPENJP2.opj_end_compress.restype = check_error<EOL>OPENJP2.opj_end_compress(codec, stream)<EOL>
End of compressing the current image.

    Wraps the openjp2 library function opj_end_compress.

    Parameters
    ----------
    codec : CODEC_TYPE
        Compressor handle.
    stream : STREAM_TYPE_P
        Output stream buffer.

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