| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- // qcamera.sip generated by MetaSIP
- //
- // This file is part of the QtMultimedia Python extension module.
- //
- // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
- //
- // This file is part of PyQt6.
- //
- // This file may be used under the terms of the GNU General Public License
- // version 3.0 as published by the Free Software Foundation and appearing in
- // the file LICENSE included in the packaging of this file. Please review the
- // following information to ensure the GNU General Public License version 3.0
- // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
- //
- // If you do not wish to use this file under the terms of the GPL version 3.0
- // then you may purchase a commercial license. For more information contact
- // info@riverbankcomputing.com.
- //
- // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- %If (Qt_6_2_0 -)
- class QCamera : public QObject
- {
- %TypeHeaderCode
- #include <qcamera.h>
- %End
- %ConvertToSubClassCode
- static struct class_graph {
- const char *name;
- sipTypeDef **type;
- int yes, no;
- } graph[] = {
- #if QT_VERSION >= 0x060800
- {sipName_QAudioBufferInput, &sipType_QAudioBufferInput, -1, 1},
- #else
- {0, 0, -1, 1},
- #endif
- #if QT_VERSION >= 0x060800
- {sipName_QAudioBufferOutput, &sipType_QAudioBufferOutput, -1, 2},
- #else
- {0, 0, -1, 2},
- #endif
- {sipName_QAudioDecoder, &sipType_QAudioDecoder, -1, 3},
- {sipName_QAudioInput, &sipType_QAudioInput, -1, 4},
- {sipName_QAudioOutput, &sipType_QAudioOutput, -1, 5},
- {sipName_QAudioSink, &sipType_QAudioSink, -1, 6},
- {sipName_QAudioSource, &sipType_QAudioSource, -1, 7},
- {sipName_QCamera, &sipType_QCamera, -1, 8},
- {sipName_QImageCapture, &sipType_QImageCapture, -1, 9},
- {sipName_QMediaCaptureSession, &sipType_QMediaCaptureSession, -1, 10},
- {sipName_QMediaDevices, &sipType_QMediaDevices, -1, 11},
- {sipName_QMediaPlayer, &sipType_QMediaPlayer, -1, 12},
- {sipName_QMediaRecorder, &sipType_QMediaRecorder, -1, 13},
- #if QT_VERSION >= 0x060500
- {sipName_QScreenCapture, &sipType_QScreenCapture, -1, 14},
- #else
- {0, 0, -1, 14},
- #endif
- {sipName_QSoundEffect, &sipType_QSoundEffect, -1, 15},
- #if QT_VERSION >= 0x060800
- {sipName_QVideoFrameInput, &sipType_QVideoFrameInput, -1, 16},
- #else
- {0, 0, -1, 16},
- #endif
- {sipName_QVideoSink, &sipType_QVideoSink, -1, 17},
- #if QT_VERSION >= 0x060600
- {sipName_QWindowCapture, &sipType_QWindowCapture, -1, -1},
- #else
- {0, 0, -1, -1},
- #endif
- };
-
- int i = 0;
-
- sipType = NULL;
-
- do
- {
- struct class_graph *cg = &graph[i];
-
- if (cg->name != NULL && sipCpp->inherits(cg->name))
- {
- sipType = *cg->type;
- i = cg->yes;
- }
- else
- i = cg->no;
- }
- while (i >= 0);
- %End
- public:
- enum Error
- {
- NoError,
- CameraError,
- };
- enum FocusMode
- {
- FocusModeAuto,
- FocusModeAutoNear,
- FocusModeAutoFar,
- FocusModeHyperfocal,
- FocusModeInfinity,
- FocusModeManual,
- };
- enum FlashMode
- {
- FlashOff,
- FlashOn,
- FlashAuto,
- };
- enum TorchMode
- {
- TorchOff,
- TorchOn,
- TorchAuto,
- };
- enum ExposureMode
- {
- ExposureAuto,
- ExposureManual,
- ExposurePortrait,
- ExposureNight,
- ExposureSports,
- ExposureSnow,
- ExposureBeach,
- ExposureAction,
- ExposureLandscape,
- ExposureNightPortrait,
- ExposureTheatre,
- ExposureSunset,
- ExposureSteadyPhoto,
- ExposureFireworks,
- ExposureParty,
- ExposureCandlelight,
- ExposureBarcode,
- };
- enum WhiteBalanceMode
- {
- WhiteBalanceAuto,
- WhiteBalanceManual,
- WhiteBalanceSunlight,
- WhiteBalanceCloudy,
- WhiteBalanceShade,
- WhiteBalanceTungsten,
- WhiteBalanceFluorescent,
- WhiteBalanceFlash,
- WhiteBalanceSunset,
- };
- enum class Feature
- {
- ColorTemperature,
- ExposureCompensation,
- IsoSensitivity,
- ManualExposureTime,
- CustomFocusPoint,
- FocusDistance,
- };
- typedef QFlags<QCamera::Feature> Features;
- QCamera(const QCameraDevice &cameraDevice, QObject *parent /TransferThis/ = 0);
- QCamera(QCameraDevice::Position position, QObject *parent /TransferThis/ = 0);
- explicit QCamera(QObject *parent /TransferThis/ = 0);
- virtual ~QCamera();
- bool isAvailable() const;
- bool isActive() const;
- QMediaCaptureSession *captureSession() const;
- QCameraDevice cameraDevice() const;
- void setCameraDevice(const QCameraDevice &cameraDevice);
- QCameraFormat cameraFormat() const;
- void setCameraFormat(const QCameraFormat &format);
- QCamera::Error error() const;
- QString errorString() const;
- QCamera::Features supportedFeatures() const;
- QCamera::FocusMode focusMode() const;
- void setFocusMode(QCamera::FocusMode mode);
- bool isFocusModeSupported(QCamera::FocusMode mode) const;
- QPointF focusPoint() const;
- QPointF customFocusPoint() const;
- void setCustomFocusPoint(const QPointF &point);
- void setFocusDistance(float d);
- float focusDistance() const;
- float minimumZoomFactor() const;
- float maximumZoomFactor() const;
- float zoomFactor() const;
- void setZoomFactor(float factor);
- QCamera::FlashMode flashMode() const;
- bool isFlashModeSupported(QCamera::FlashMode mode) const;
- bool isFlashReady() const;
- QCamera::TorchMode torchMode() const;
- bool isTorchModeSupported(QCamera::TorchMode mode) const;
- QCamera::ExposureMode exposureMode() const;
- bool isExposureModeSupported(QCamera::ExposureMode mode) const;
- float exposureCompensation() const;
- int isoSensitivity() const;
- int manualIsoSensitivity() const;
- float exposureTime() const;
- float manualExposureTime() const;
- int minimumIsoSensitivity() const;
- int maximumIsoSensitivity() const;
- float minimumExposureTime() const;
- float maximumExposureTime() const;
- QCamera::WhiteBalanceMode whiteBalanceMode() const;
- bool isWhiteBalanceModeSupported(QCamera::WhiteBalanceMode mode) const;
- int colorTemperature() const;
- public slots:
- void setActive(bool active);
- void start();
- void stop();
- void zoomTo(float zoom, float rate);
- void setFlashMode(QCamera::FlashMode mode);
- void setTorchMode(QCamera::TorchMode mode);
- void setExposureMode(QCamera::ExposureMode mode);
- void setExposureCompensation(float ev);
- void setManualIsoSensitivity(int iso);
- void setAutoIsoSensitivity();
- void setManualExposureTime(float seconds);
- void setAutoExposureTime();
- void setWhiteBalanceMode(QCamera::WhiteBalanceMode mode);
- void setColorTemperature(int colorTemperature);
- signals:
- void activeChanged(bool);
- void errorChanged();
- void errorOccurred(QCamera::Error error, const QString &errorString);
- void cameraDeviceChanged();
- void cameraFormatChanged();
- void supportedFeaturesChanged();
- void focusModeChanged();
- void zoomFactorChanged(float);
- void minimumZoomFactorChanged(float);
- void maximumZoomFactorChanged(float);
- void focusDistanceChanged(float);
- void customFocusPointChanged();
- void flashReady(bool);
- void flashModeChanged();
- void torchModeChanged();
- void exposureTimeChanged(float speed);
- void isoSensitivityChanged(int);
- void exposureCompensationChanged(float);
- void exposureModeChanged();
- void whiteBalanceModeChanged() const;
- void colorTemperatureChanged() const;
- void focusPointChanged();
- void manualExposureTimeChanged(float speed);
- void manualIsoSensitivityChanged(int);
- };
- %End
|