def setup_encoder(codec, cparams, image):
ARGTYPES = [CODEC_TYPE,<EOL>ctypes.POINTER(CompressionParametersType),<EOL>ctypes.POINTER(ImageType)]<EOL>OPENJP2.opj_setup_encoder.argtypes = ARGTYPES<EOL>OPENJP2.opj_setup_encoder.restype = check_error<EOL>OPENJP2.opj_setup_encoder(codec, ctypes.byref(cparams), image)<EOL>
Wraps openjp2 library function opj_setup_encoder.

    Setup the encoder parameters using the current image and using user
    parameters.

    Parameters
    ----------
    codec : CODEC_TYPE
        codec initialized by create_compress function
    cparams : CompressionParametersType
        compression parameters
    image : ImageType
        input-filled image

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