<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode(cinfo, cio, image):
 """Wrapper for openjpeg library function opj_encode. Encodes an image into a JPEG-2000 codestream. Parameters cinfo : compression handle cio : output buffer stream image : image to encode """

    argtypes = [ctypes.POINTER(CompressionInfoType),
                ctypes.POINTER(CioType),
                ctypes.POINTER(ImageType)]
    OPENJPEG.opj_encode.argtypes = argtypes
    OPENJPEG.opj_encode.restype = ctypes.c_int
    status = OPENJPEG.opj_encode(cinfo, cio, image)
    return status