void CameraControl::setupCamera(QCamera * camera) { this->camera = camera; QCameraFocus * focus = camera->focus(); focus->setFocusMode(QCameraFocus::ContinuousFocus); focus->setFocusPointMode(QCameraFocus::FocusPointAuto); camera->imageProcessing()->setWhiteBalanceMode(QCameraImageProcessing::WhiteBalanceAuto); camera->setCaptureMode(QCamera::CaptureViewfinder); QCameraExposure * exposure = camera->exposure(); exposure->setExposureMode(QCameraExposure::ExposureAuto); exposure->setExposureCompensation(0); exposure->setMeteringMode(QCameraExposure::MeteringSpot); imageCapture = new QCameraImageCapture(camera, this); connect(imageCapture, SIGNAL(imageSaved(int, QString)), this, SLOT(onSavedImageCaptured(int, QString))); //camera->load(); //camera->start(); }
static PyObject *meth_QCameraFocus_setFocusMode(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { QCameraFocus::FocusModes* a0; int a0State = 0; QCameraFocus *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QCameraFocus, &sipCpp, sipType_QCameraFocus_FocusModes, &a0, &a0State)) { sipCpp->setFocusMode(*a0); sipReleaseType(a0,sipType_QCameraFocus_FocusModes,a0State); Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QCameraFocus, sipName_setFocusMode, doc_QCameraFocus_setFocusMode); return NULL; }