def _set_zoom(self, value):
    self._check_camera_open()
    try:
        (x, y, w, h) = value
    except (TypeError, ValueError) as e:
        raise PiCameraValueError(('Invalid zoom rectangle (x, y, w, h) tuple: %s' % value))
    mp = mmal.MMAL_PARAMETER_INPUT_CROP_T(mmal.MMAL_PARAMETER_HEADER_T(mmal.MMAL_PARAMETER_INPUT_CROP, ct.sizeof(mmal.MMAL_PARAMETER_INPUT_CROP_T)), mmal.MMAL_RECT_T(max(0, min(65535, int((65535 * x)))), max(0, min(65535, int((65535 * y)))), max(0, min(65535, int((65535 * w)))), max(0, min(65535, int((65535 * h))))))
    self._camera.control.params[mmal.MMAL_PARAMETER_INPUT_CROP] = mp
def _set_zoom(self, value):
    self._check_camera_open()
    try:
        (x, y, w, h) = value
    except (TypeError, ValueError) as e:
        raise PiCameraValueError(('Invalid zoom rectangle (x, y, w, h) tuple: %s' % value))
    mp = mmal.MMAL_PARAMETER_INPUT_CROP_T(mmal.MMAL_PARAMETER_HEADER_T(mmal.MMAL_PARAMETER_INPUT_CROP, ct.sizeof(mmal.MMAL_PARAMETER_INPUT_CROP_T)), mmal.MMAL_RECT_T(max(0, min(65535, int((65535 * x)))), max(0, min(65535, int((65535 * y)))), max(0, min(65535, int((65535 * w)))), max(0, min(65535, int((65535 * h))))))
    self._camera.control.params[mmal.MMAL_PARAMETER_INPUT_CROP] = mp