Auf dieser Seite

QPixelFormat Class

QPixelFormat ist eine Klasse zur Beschreibung von verschiedenen Pixel-Layouts in Grafikpuffern. Mehr...

Kopfzeile: #include <QPixelFormat>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

Öffentliche Typen

enum AlphaPosition { AtBeginning, AtEnd }
enum AlphaPremultiplied { NotPremultiplied, Premultiplied }
enum AlphaUsage { IgnoresAlpha, UsesAlpha }
enum ByteOrder { LittleEndian, BigEndian, CurrentSystemEndian }
enum ColorModel { RGB, BGR, Indexed, Grayscale, CMYK, …, Alpha }
enum TypeInterpretation { UnsignedInteger, UnsignedShort, UnsignedByte, FloatingPoint }
enum YUVLayout { YUV444, YUV422, YUV411, YUV420P, YUV420SP, …, Y16 }

Öffentliche Funktionen

QPixelFormat()
QPixelFormat(QPixelFormat::ColorModel colorModel, uchar firstSize, uchar secondSize, uchar thirdSize, uchar fourthSize, uchar fifthSize, uchar alphaSize, QPixelFormat::AlphaUsage alphaUsage, QPixelFormat::AlphaPosition alphaPosition, QPixelFormat::AlphaPremultiplied premultiplied, QPixelFormat::TypeInterpretation typeInterpretation, QPixelFormat::ByteOrder byteOrder = CurrentSystemEndian, uchar subEnum = 0)
QPixelFormat::AlphaPosition alphaPosition() const
uchar alphaSize() const
QPixelFormat::AlphaUsage alphaUsage() const
uchar bitsPerPixel() const
uchar blackSize() const
uchar blueSize() const
uchar brightnessSize() const
QPixelFormat::ByteOrder byteOrder() const
uchar channelCount() const
QPixelFormat::ColorModel colorModel() const
uchar cyanSize() const
uchar greenSize() const
uchar hueSize() const
uchar lightnessSize() const
uchar magentaSize() const
QPixelFormat::AlphaPremultiplied premultiplied() const
uchar redSize() const
uchar saturationSize() const
QPixelFormat::TypeInterpretation typeInterpretation() const
uchar yellowSize() const
QPixelFormat::YUVLayout yuvLayout() const
QPixelFormat qPixelFormatAlpha(uchar channelSize, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)
QPixelFormat qPixelFormatCmyk(uchar channelSize, uchar alphaSize = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)
QPixelFormat qPixelFormatGrayscale(uchar channelSize, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)
QPixelFormat qPixelFormatHsl(uchar channelSize, uchar alphaSize = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::FloatingPoint)
QPixelFormat qPixelFormatHsv(uchar channelSize, uchar alphaSize = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::FloatingPoint)
QPixelFormat qPixelFormatRgba(uchar redSize, uchar greenSize, uchar blueSize, uchar alphaSize, QPixelFormat::AlphaUsage alphaUsage, QPixelFormat::AlphaPosition alphaPosition, QPixelFormat::AlphaPremultiplied premultiplied = QPixelFormat::NotPremultiplied, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)
QPixelFormat qPixelFormatYuv(QPixelFormat::YUVLayout yuvLayout, uchar alphaSize = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::AlphaPremultiplied premultiplied = QPixelFormat::NotPremultiplied, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedByte, QPixelFormat::ByteOrder byteOrder = QPixelFormat::BigEndian)

Detaillierte Beschreibung

In Qt besteht oft die Notwendigkeit, das Layout der Pixel in einem Grafikpuffer darzustellen. QPixelFormat kann bis zu 5 Farbkanäle und 1 Alphakanal beschreiben, einschließlich Details darüber, wie diese Kanäle im Speicher einzeln und in Beziehung zueinander dargestellt werden.

typeInterpretation() und byteOrder() bestimmen, wie jedes Pixel gelesen/interpretiert werden soll, während alphaSize(), alphaUsage(), alphaPosition() und premultiplied() die Position und Eigenschaften des möglichen Alphakanals beschreiben.

Es gibt keine Unterstützung für die Beschreibung von YUV-Makropixeln. Stattdessen wird eine Liste von YUV formats bereitgestellt. Wenn ein QPixelFormat ein YUV-Format beschreibt, wird der Wert bitsPerPixel() aus dem YUV-Layout abgeleitet.

Dokumentation der Mitgliedstypen

enum QPixelFormat::AlphaPosition

Diese Aufzählung beschreibt die alpha position des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::AtBeginning0Der Alphakanal wird den Farbkanälen vorangestellt. Z.B. ARGB.
QPixelFormat::AtEnd1Der Alphakanal wird hinter den Farbkanälen eingefügt. Z. B. RGBA.

Siehe auch alphaSize(), alphaUsage(), und premultiplied().

enum QPixelFormat::AlphaPremultiplied

Dieses Enum beschreibt, ob der Alphakanal des Pixelformats premultiplied in den Farbkanälen enthalten ist oder nicht.

KonstanteWertBeschreibung
QPixelFormat::NotPremultiplied0Der Alphakanal wird nicht mit den Farbkanälen multipliziert.
QPixelFormat::Premultiplied1Der Alphakanal wird mit den Farbkanälen multipliziert.

Siehe auch alphaSize(), alphaUsage(), und alphaPosition().

enum QPixelFormat::AlphaUsage

Diese Aufzählung beschreibt die alpha usage des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::IgnoresAlpha1Der Alphakanal wird nicht verwendet.
QPixelFormat::UsesAlpha0Der Alphakanal wird verwendet.

Siehe auch alphaSize(), alphaPosition(), und premultiplied().

enum QPixelFormat::ByteOrder

Diese Aufzählung beschreibt die byte order des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::LittleEndian0Die Byte-Reihenfolge ist Little Endian.
QPixelFormat::BigEndian1Die Bytereihenfolge ist Big Endian.
QPixelFormat::CurrentSystemEndian2Diese Aufzählung wird nicht gespeichert, sondern im Konstruktor in die endianische Aufzählung umgewandelt, die der Aufzählung des aktuellen Systems entspricht.

Siehe auch typeInterpretation().

enum QPixelFormat::ColorModel

Diese Aufzählung beschreibt die color model des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::RGB0Das Farbmodell ist RGB.
QPixelFormat::BGR1Dies ist logischerweise die entgegengesetzte endianische Version von RGB. Der Einfachheit halber hat es jedoch sein eigenes Modell.
QPixelFormat::Indexed2Das Farbmodell verwendet eine Farbpalette.
QPixelFormat::Grayscale3Das Farbmodell ist Grayscale.
QPixelFormat::CMYK4Das Farbmodell ist CMYK.
QPixelFormat::HSL5Das Farbmodell ist HSL.
QPixelFormat::HSV6Das Farbmodell ist HSV.
QPixelFormat::YUV7Das Farbmodell ist YUV.
QPixelFormat::Alpha8[seit 5.5] Es gibt kein Farbmodell, nur Alpha wird verwendet.

enum QPixelFormat::TypeInterpretation

Diese Aufzählung beschreibt die type interpretation des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::UnsignedInteger0Die Pixel sollten als ein oder mehrere unsigned int gelesen werden.
QPixelFormat::UnsignedShort1Die Pixel sollten als ein oder mehrere unsigned short gelesen werden.
QPixelFormat::UnsignedByte2Die Pixel sollten als ein oder mehrere byte gelesen werden.
QPixelFormat::FloatingPoint3Die Pixel sollten als eine oder mehrere Fließkommazahlen gelesen werden, wobei der konkrete Typ durch den Farb-/Alpha-Kanal definiert ist, d. h. qfloat16 für 16-Bit-Halbfließkommaformate und float für 32-Bit-Vollfließkommaformate.

Siehe auch byteOrder().

enum QPixelFormat::YUVLayout

Diese Aufzählung beschreibt die YUV layout des Pixelformats, vorausgesetzt, es hat ein Farbmodell von QPixelFormat::YUV.

KonstanteWert
QPixelFormat::YUV4440
QPixelFormat::YUV4221
QPixelFormat::YUV4112
QPixelFormat::YUV420P3
QPixelFormat::YUV420SP4
QPixelFormat::YV125
QPixelFormat::UYVY6
QPixelFormat::YUYV7
QPixelFormat::NV128
QPixelFormat::NV219
QPixelFormat::IMC110
QPixelFormat::IMC211
QPixelFormat::IMC312
QPixelFormat::IMC413
QPixelFormat::Y814
QPixelFormat::Y1615

Mitgliederfunktion Dokumentation

[constexpr noexcept] QPixelFormat::QPixelFormat()

Erzeugt ein Null-Pixelformat. Dieses Format wird auf QImage::Format_Invalid abgebildet.

[constexpr noexcept] QPixelFormat::QPixelFormat(QPixelFormat::ColorModel colorModel, uchar firstSize, uchar secondSize, uchar thirdSize, uchar fourthSize, uchar fifthSize, uchar alphaSize, QPixelFormat::AlphaUsage alphaUsage, QPixelFormat::AlphaPosition alphaPosition, QPixelFormat::AlphaPremultiplied premultiplied, QPixelFormat::TypeInterpretation typeInterpretation, QPixelFormat::ByteOrder byteOrder = CurrentSystemEndian, uchar subEnum = 0)

Erzeugt ein QPixelFormat, das seine Daten den Attributen zuordnet. colorModel wird in einen 4 Bit langen Puffer gelegt.

firstSize secondSize thirdSize fourthSize fifthSize alphaSize sind alle dazu gedacht, die Größe eines Kanals zu repräsentieren. Die Kanäle werden je nach colorModel für unterschiedliche Zwecke verwendet. Bei RGB steht firstSize für den Rotkanal. Bei CMYK steht er für den Wert des Cyan-Kanals.

alphaUsage gibt an, ob der Alphakanal verwendet wird oder nicht.

alphaPosition ist die Position des Alphakanals.

premultiplied gibt an, ob der Alphakanal bereits mit den Farbkanälen multipliziert wurde.

typeInterpretation steht dafür, wie das Pixel interpretiert wird.

byteOrder steht für die Endianness des Pixelformats. Der Standardwert ist CurrentSystemEndian, der bei Formaten ohne Byte-Reihenfolge in die Endianness des Systems aufgelöst wird, und QPixelFormat::BigEndian für QPixelFormat::UnsignedByte.

subEnum wird für colorModels verwendet, die einige zusätzliche Informationen speichern müssen, indem sie ein zusätzliches Enum liefern. Dies wird von YUV verwendet, um den YUV-Typ zu speichern. Der Standardwert ist 0.

Hinweis: BGR-Formate haben ihr eigenes Farbmodell und sollten nicht durch Verwendung der entgegengesetzten Endianness eines RGB-Formats beschrieben werden.

[constexpr noexcept] QPixelFormat::AlphaPosition QPixelFormat::alphaPosition() const

Accessor-Funktion für die Position des Alphakanals relativ zu den Farbkanälen.

Bei Formaten, bei denen die einzelnen Kanäle auf einzelne Einheiten abgebildet werden, ist die Alpha-Position relativ zu diesen Einheiten. Zum Beispiel für QImage::Format_RGBA16FPx4, das eine Alphaposition von QPixelFormat::AtEnd hat, ist die Alphaposition die zuletzt gelesene qfloat16.

Bei Formaten, bei denen mehrere Kanäle in eine einzige Einheit gepackt sind, werden die Werte QPixelFormat::AtBeginning und QPixelFormat::AtEnd den höchst- und niedrigstwertigen Bits der gepackten Einheit zugeordnet, und zwar in Bezug auf die formatinterne byteOrder().

Für QImage::Format_ARGB32 beispielsweise, das eine Typinterpretation von QPixelFormat::UnsignedInteger und ein byteOrder() hat, das immer mit dem Hostsystem übereinstimmt, bedeutet die Alpha-Position von QPixelFormat::AtBeginning, dass das Alpha immer unter 0xFF000000 zu finden ist.

Wenn das Pixelformat und die Host-Endianness nicht übereinstimmen, muss darauf geachtet werden, dass das Pixelformat-Layout korrekt auf das Host-Speicherlayout abgebildet wird.

Siehe auch alphaUsage(), alphaSize(), und premultiplied().

[constexpr noexcept] uchar QPixelFormat::alphaSize() const

Accessor-Funktion für die Größe des Alphakanals.

[constexpr noexcept] QPixelFormat::AlphaUsage QPixelFormat::alphaUsage() const

Accessor-Funktion, die anzeigt, ob der Alphakanal verwendet wird oder nicht.

Manchmal reserviert das Pixelformat Platz für einen Alphakanal, so dass alphaSize() > 0 zurückgibt, aber der Alphakanal nicht verwendet/ignoriert wird.

Für QImage::Format_RGB32 ist bitsPerPixel() zum Beispiel 32, weil der Alphakanal eine Größe von 8 hat, aber alphaUsage() spiegelt QPixelFormat::IgnoresAlpha wider.

Beachten Sie, dass in solchen Situationen die position des nicht verwendeten Alphakanals immer noch wichtig ist, da sie die Platzierung der Farbkanäle beeinflusst.

Siehe auch alphaPosition(), alphaSize(), und premultiplied().

[constexpr noexcept] uchar QPixelFormat::bitsPerPixel() const

Accessor-Funktion für die pro Pixel verwendeten Bits. Diese Funktion gibt die Summe aller Farbkanäle + die Größe des Alphakanals zurück.

[constexpr noexcept] uchar QPixelFormat::blackSize() const

Accessor-Funktion für den Schwarz/Key-Farbkanal.

[constexpr noexcept] uchar QPixelFormat::blueSize() const

Accessor-Funktion für die Größe des blauen Farbkanals.

[constexpr noexcept] uchar QPixelFormat::brightnessSize() const

Accessor-Funktion für die Größe des Helligkeitskanals.

[constexpr noexcept] QPixelFormat::ByteOrder QPixelFormat::byteOrder() const

Die Bytereihenfolge des Pixelformats bestimmt das Speicherlayout der einzelnen Typeneinheiten, wie durch typeInterpretation() beschrieben.

Diese Funktion wird niemals QPixelFormat::CurrentSystemEndian zurückgeben, da dieser Wert im Konstruktor in den Endian-Wert des Systems übersetzt wird.

Für Pixelformate mit typeInterpretation() QPixelFormat::UnsignedByte wird dies typischerweise QPixelFormat::BigEndian sein, während andere Typinterpretationen typischerweise die Endianness des aktuellen Systems widerspiegeln werden.

Wenn die Bytereihenfolge des Pixelformats mit dem aktuellen System übereinstimmt, können die einzelnen Typeinheiten unabhängig von der Endianness des Hostsystems mit denselben Bitmasken und Operationen gelesen und bearbeitet werden. So kann z. B. bei QImage::Format_ARGB32, das eine QPixelFormat::UnsignedInteger -Typinterpretation hat, Alpha immer gelesen werden, indem unsigned int durch 0xFF000000 maskiert wird, unabhängig von der Endianness des Hostsystems.

Wenn das Pixelformat und die Endianness des Hosts nicht übereinstimmen, muss dies beachtet werden. Klassen wie QImage vertauschen in diesen Fällen die internen Bits nicht, um sie an die Endianness des Hostsystems anzupassen.

Siehe auch typeInterpretation() und alphaPosition().

[constexpr noexcept] uchar QPixelFormat::channelCount() const

Accessor-Funktion für die Kanalanzahl.

Die Kanalanzahl repräsentiert Kanäle (Farbe und Alpha) mit einer Größe > 0.

[constexpr noexcept] QPixelFormat::ColorModel QPixelFormat::colorModel() const

Accessor-Funktion für das Farbmodell.

Beachten Sie, dass für QPixelFormat::YUV die einzelnen Makro-Pixel nicht beschrieben werden können. Stattdessen wird eine Liste von YUV formats bereitgestellt, und der Wert bitsPerPixel() wird aus dem YUV-Layout abgeleitet.

[constexpr noexcept] uchar QPixelFormat::cyanSize() const

Accessor-Funktion für den Cyan-Farbkanal.

[constexpr noexcept] uchar QPixelFormat::greenSize() const

Accessor-Funktion für die Größe des grünen Farbkanals.

[constexpr noexcept] uchar QPixelFormat::hueSize() const

Accessor-Funktion für die Größe des Farbtonkanals.

[constexpr noexcept] uchar QPixelFormat::lightnessSize() const

Accessor-Funktion für die Größe des Helligkeitskanals.

[constexpr noexcept] uchar QPixelFormat::magentaSize() const

Accessor-Funktion für den Megenta-Farbkanal.

[constexpr noexcept] QPixelFormat::AlphaPremultiplied QPixelFormat::premultiplied() const

Zugriffsfunktion für die Angabe, ob der Alphakanal mit den Farbkanälen multipliziert wird.

[constexpr noexcept] uchar QPixelFormat::redSize() const

Accessor-Funktion für die Größe des roten Farbkanals.

[constexpr noexcept] uchar QPixelFormat::saturationSize() const

Accessor-Funktion für die Größe des Sättigungskanals.

[constexpr noexcept] QPixelFormat::TypeInterpretation QPixelFormat::typeInterpretation() const

Die Interpretation des Typs bestimmt, wie jedes Pixel gelesen werden soll.

Jedes Pixel wird als eine oder mehrere Einheiten des angegebenen Typs dargestellt, die nacheinander im Speicher angeordnet sind.

Hinweis: Die byte order des Pixelformats und die Endianness des Hostsystems wirken sich nur auf die Speicheranordnung jeder einzelnen gelesenen Einheit aus, nicht aber auf die relative Anordnung der Einheiten.

Zum Beispiel hat QImage::Format_Mono eine pixel format von 1 Bit pro Pixel und eine QPixelFormat::UnsignedByte Typinterpretation, die als eine einzige byte gelesen werden sollte. In ähnlicher Weise hat QImage::Format_RGB888 eine pixel format von 24 Bits pro Pixel und eine QPixelFormat::UnsignedByte Interpretation, die als drei aufeinanderfolgende bytegelesen werden sollte.

Viele der Formate QImage formats sind 32-Bit-Formate mit einer Typinterpretation von QPixelFormat::UnsignedInteger, die als ein einzelnes unsigned int gelesen werden sollten.

Bei QPixelFormat::FloatingPoint -Formaten wie QImage::Format_RGBA16FPx4 oder QImage::Format_RGBA32FPx4 wird der Typ anhand der Größe der einzelnen Farb-/Alphakanäle bestimmt, wobei qfloat16 für 16-Bit-Halbfließkommaformate und float für 32-Bit-Vollfließkommaformate steht.

Siehe auch byteOrder().

[constexpr noexcept] uchar QPixelFormat::yellowSize() const

Accessor-Funktion für den gelben Farbkanal.

[constexpr noexcept] QPixelFormat::YUVLayout QPixelFormat::yuvLayout() const

Accessor-Funktion für die YUVLayout. Es ist schwierig, die Farbkanäle eines YUV-Pixelformats zu beschreiben, da das YUV-Farbmodell Makropixel verwendet. Stattdessen wird das Layout der Pixel als Enum gespeichert.

Verwandte Nicht-Mitglieder

[constexpr noexcept] QPixelFormat qPixelFormatAlpha(uchar channelSize, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)

Konstruktorfunktion zur Erstellung eines Alpha-Formats. Ein Maskenformat kann durch die Übergabe von 1 an channelSize beschrieben werden. Es ist auch möglich, sehr genaue Alpha-Formate zu definieren, die Doppelwerte zur Beschreibung jedes Pixels verwenden, indem 8 als channelSize und FloatingPoint als typeInterpretation übergeben werden.

Siehe auch QPixelFormat::TypeInterpretation.

[constexpr noexcept] QPixelFormat qPixelFormatCmyk(uchar channelSize, uchar alphaSize = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)

Konstruktorfunktion zur Erstellung von CMYK-Formaten. Die Anzahl der Kanäle wird 4 oder 5 sein, je nachdem, ob alphaSize größer als Null ist oder nicht. Die CMYK-Farbkanäle werden alle auf den Wert von channelSize gesetzt.

alphaUsage alphaPosition und typeInterpretation sind alle über die gleichnamigen Accessoren zugänglich.

Siehe auch QPixelFormat::TypeInterpretation.

[constexpr noexcept] QPixelFormat qPixelFormatGrayscale(uchar channelSize, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)

Konstruktorfunktion zur Erstellung eines Graustufenformats. Monochrome Formate können durch die Übergabe von 1 an channelSize beschrieben werden. Es ist auch möglich, sehr genaue Graustufenformate zu definieren, die Doubles zur Beschreibung jedes Pixels verwenden, indem 8 als channelSize und FloatingPoint als typeInterpretation übergeben werden.

Siehe auch QPixelFormat::TypeInterpretation.

[constexpr noexcept] QPixelFormat qPixelFormatHsl(uchar channelSize, uchar alphaSize = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::FloatingPoint)

Konstruktorfunktion zur Erstellung von HSL-Formaten. Die Anzahl der Kanäle wird 3 oder 4 sein, je nachdem, ob alphaSize größer als 0 ist.

channelSize setzt die hueSize saturationSize und lightnessSize auf den gleichen Wert.

alphaUsage alphaPosition und typeInterpretation sind alle über die gleichnamigen Accessoren zugänglich.

[constexpr noexcept] QPixelFormat qPixelFormatHsv(uchar channelSize, uchar alphaSize = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::FloatingPoint)

Konstruktorfunktion zur Erstellung von HSV-Formaten. Die Anzahl der Kanäle wird 3 oder 4 sein, je nachdem, ob alphaSize größer als 0 ist.

channelSize setzt die hueSize saturationSize und brightnessSize auf denselben Wert.

alphaUsage alphaPosition und typeInterpretation sind alle über die gleichnamigen Accessoren zugänglich.

[constexpr noexcept] QPixelFormat qPixelFormatRgba(uchar redSize, uchar greenSize, uchar blueSize, uchar alphaSize, QPixelFormat::AlphaUsage alphaUsage, QPixelFormat::AlphaPosition alphaPosition, QPixelFormat::AlphaPremultiplied premultiplied = QPixelFormat::NotPremultiplied, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger)

Konstruktorfunktion zur Erstellung eines RGB-Pixelformats. redSize greenSize blueSize stellt die Größe der einzelnen Farbkanäle dar. alphaSize beschreibt die Größe des Alphakanals und seine Position wird mit alphaPosition beschrieben. alphaUsage wird verwendet, um zu bestimmen, ob der Alphakanal verwendet wird oder nicht. Wenn man die Größe des Alphakanals auf 8 und alphaUsage auf IgnoresAlpha setzt, ist es möglich, ein 32-Bit-Format zu erzeugen, bei dem die RGB-Kanäle zusammen nur 24 Bit verwenden. premultiplied typeInterpretation sind über gleichnamige Accessoren zugänglich.

Siehe auch QPixelFormat::TypeInterpretation.

QPixelFormat qPixelFormatYuv(QPixelFormat::YUVLayout yuvLayout, uchar alphaSize = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::AlphaPremultiplied premultiplied = QPixelFormat::NotPremultiplied, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedByte, QPixelFormat::ByteOrder byteOrder = QPixelFormat::BigEndian)

Konstruktorfunktion zur Erstellung eines QPixelFormat, das ein YUV-Format mit yuvLayout beschreibt. alphaSize beschreibt die Größe eines möglichen Alphakanals und seine Position wird mit alphaPosition beschrieben. Die "ersten" "zweiten" ... "fünften" Kanäle sind alle auf 0 gesetzt. alphaUsage premultiplied typeInterpretation und byteOrder funktionieren wie bei anderen Formaten.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.