diff options
Diffstat (limited to 'src/multimedia/recording/qmediaencodersettings.cpp')
-rw-r--r-- | src/multimedia/recording/qmediaencodersettings.cpp | 229 |
1 files changed, 0 insertions, 229 deletions
diff --git a/src/multimedia/recording/qmediaencodersettings.cpp b/src/multimedia/recording/qmediaencodersettings.cpp index 561a63de9..833155089 100644 --- a/src/multimedia/recording/qmediaencodersettings.cpp +++ b/src/multimedia/recording/qmediaencodersettings.cpp @@ -344,233 +344,4 @@ bool QMediaEncoderSettings::operator==(const QMediaEncoderSettings &other) const d->videoBitRate == other.d->videoBitRate; } - -class QImageEncoderSettingsPrivate : public QSharedData -{ -public: - bool isNull = true; - QImageEncoderSettings::FileFormat format = QImageEncoderSettings::UnspecifiedFormat; - QSize resolution; - QImageEncoderSettings::Quality quality = QImageEncoderSettings::NormalQuality; -}; - -/*! - \class QImageEncoderSettings - - - \brief The QImageEncoderSettings class provides a set of image encoder - settings. - - \inmodule QtMultimedia - \ingroup multimedia - \ingroup multimedia_camera - - A image encoder settings object is used to specify the image encoder - settings used by QCameraImageCapture. Image encoder settings are selected - by constructing a QImageEncoderSettings object, setting the desired - properties and then passing it to a QCameraImageCapture instance using the - QCameraImageCapture::setImageSettings() function. - - \snippet multimedia-snippets/media.cpp Image encoder settings - - \sa QImageEncoderControl -*/ - -/*! - Constructs a null image encoder settings object. -*/ - -QImageEncoderSettings::QImageEncoderSettings() - :d(new QImageEncoderSettingsPrivate) -{ -} - -/*! - Constructs a copy of the image encoder settings object \a other. -*/ - -QImageEncoderSettings::QImageEncoderSettings(const QImageEncoderSettings& other) = default; - -/*! - Destroys a image encoder settings object. -*/ - -QImageEncoderSettings::~QImageEncoderSettings() = default; - -/*! - Assigns the value of \a other to a image encoder settings object. -*/ -QImageEncoderSettings &QImageEncoderSettings::operator=(const QImageEncoderSettings &other) = default; - -/*! - Determines if \a other is of equal value to a image encoder settings - object. - - Returns true if the settings objects are of equal value, and false if they - are not of equal value. -*/ -bool QImageEncoderSettings::operator==(const QImageEncoderSettings &other) const -{ - return (d == other.d) || - (d->isNull == other.d->isNull && - d->quality == other.d->quality && - d->format == other.d->format && - d->resolution == other.d->resolution); - -} - -/*! - Determines if \a other is of equal value to a image encoder settings - object. - - Returns true if the settings objects are not of equal value, and false if - they are of equal value. -*/ -bool QImageEncoderSettings::operator!=(const QImageEncoderSettings &other) const -{ - return !(*this == other); -} - -/*! - Identifies if a image encoder settings object is uninitalized. - - Returns true if the settings are null, and false if they are not. -*/ -bool QImageEncoderSettings::isNull() const -{ - return d->isNull; -} - -/*! - Returns the image format. -*/ - -QImageEncoderSettings::FileFormat QImageEncoderSettings::format() const -{ - return d->format; -} - -/*! - Sets the image \a format. -*/ -void QImageEncoderSettings::setFormat(QImageEncoderSettings::FileFormat format) -{ - d->isNull = false; - d->format = format; -} - -QList<QImageEncoderSettings::FileFormat> QImageEncoderSettings::supportedFormats() -{ - return QPlatformMediaIntegration::instance()->formatInfo()->imageFormats; -} - -QString QImageEncoderSettings::fileFormatName(QImageEncoderSettings::FileFormat f) -{ - const char *name = nullptr; - switch (f) { - case UnspecifiedFormat: - name = "Unspecified image format"; - break; - case JPEG: - name = "JPEG"; - break; - case PNG: - name = "PNG"; - break; - case WebP: - name = "WebP"; - break; - case Tiff: - name = "Tiff"; - break; - } - return QString::fromUtf8(name); -} - -QString QImageEncoderSettings::fileFormatDescription(QImageEncoderSettings::FileFormat f) -{ - const char *name = nullptr; - switch (f) { - case UnspecifiedFormat: - name = "Unspecified image format"; - break; - case JPEG: - name = "JPEG"; - break; - case PNG: - name = "PNG"; - break; - case WebP: - name = "WebP"; - break; - case Tiff: - name = "Tiff"; - break; - } - return QString::fromUtf8(name); -} - -/*! - Returns the resolution of the encoded image. -*/ - -QSize QImageEncoderSettings::resolution() const -{ - return d->resolution; -} - -/*! - Sets the \a resolution of the encoded image. - - An empty QSize indicates the encoder should make an optimal choice based on - what is available from the image source and the limitations of the codec. -*/ - -void QImageEncoderSettings::setResolution(const QSize &resolution) -{ - d->isNull = false; - d->resolution = resolution; -} - -/*! - Sets the \a width and \a height of the resolution of the encoded image. - - \overload -*/ - -void QImageEncoderSettings::setResolution(int width, int height) -{ - d->isNull = false; - d->resolution = QSize(width, height); -} - -/*! - \enum QImageEncoderSettings::EncodingQuality - - Enumerates quality encoding levels. - - \value VeryLowQuality - \value LowQuality - \value NormalQuality - \value HighQuality - \value VeryHighQuality -*/ - -/*! - Returns the image encoding quality. -*/ -QImageEncoderSettings::Quality QImageEncoderSettings::quality() const -{ - return d->quality; -} - -/*! - Sets the image encoding \a quality. -*/ -void QImageEncoderSettings::setQuality(Quality quality) -{ - d->isNull = false; - d->quality = quality; -} - QT_END_NAMESPACE |