'Wraps a nested python sequence.'

def wrap(self, gammaramp):

    (red, green, blue) = gammaramp
    size = min(len(red), len(green), len(blue))
    array_type = (ctypes.c_ushort * size)
    self.size = ctypes.c_uint(size)
    self.red_array = array_type()
    self.green_array = array_type()
    self.blue_array = array_type()
    for i in range(self.size):
        self.red_array[i] = int((red[i] * 65535))
        self.green_array[i] = int((green[i] * 65535))
        self.blue_array[i] = int((blue[i] * 65535))
    pointer_type = ctypes.POINTER(ctypes.c_ushort)
    self.red = ctypes.cast(self.red_array, pointer_type)
    self.green = ctypes.cast(self.green_array, pointer_type)
    self.blue = ctypes.cast(self.blue_array, pointer_type)
