<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup_encoder(codec, cparams, image):
 """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. """

    ARGTYPES = [CODEC_TYPE,
                ctypes.POINTER(CompressionParametersType),
                ctypes.POINTER(ImageType)]
    OPENJP2.opj_setup_encoder.argtypes = ARGTYPES
    OPENJP2.opj_setup_encoder.restype = check_error
    OPENJP2.opj_setup_encoder(codec, ctypes.byref(cparams), image)