Auf dieser Seite

QPixelFormat Class

QPixelFormat ist eine Klasse zur Beschreibung verschiedener Pixelanordnungen in Grafikpuffern. Mehr...

Header: #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)

Ausführliche Beschreibung

In Qt besteht häufig 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.

Die Methoden ` typeInterpretation()` und ` byteOrder()` legen fest, wie jedes Pixel gelesen bzw. 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 von „ bitsPerPixel()“ aus dem YUV-Layout abgeleitet.

Dokumentation zu den Mitgliedstypen

enum QPixelFormat::AlphaPosition

Diese Enumeration beschreibt die „ alpha position “ des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::AtBeginning0Der Alphakanal wird vor die Farbkanäle gesetzt. Z. B. ARGB.
QPixelFormat::AtEnd1Der Alphakanal wird hinter die Farbkanäle gestellt. Z. B. RGBA.

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

enum QPixelFormat::AlphaPremultiplied

Diese Enumeration gibt an, ob der Alphakanal des Pixelformats in die Farbkanäle „ premultiplied “ integriert ist oder nicht.

KonstanteWertBeschreibung
QPixelFormat::NotPremultiplied0Der Alphakanal wird nicht in die Farbkanälexml-ph-0000@deepl.internaliert.
QPixelFormat::Premultiplied1Der Alphakanal wird in die Farbkanäle einberechnet.

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

enum QPixelFormat::AlphaUsage

Diese Enumeration 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 Enumeration beschreibt die „ byte order “ des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::LittleEndian0Die Byte-Reihenfolge ist „Little Endian“.
QPixelFormat::BigEndian1Die Byte-Reihenfolge ist Big-Endian.
QPixelFormat::CurrentSystemEndian2Diese Enumeration wird nicht gespeichert, sondern im Konstruktor in die Endian-Enumeration konvertiert, die der Enumeration des aktuellen Systems entspricht.

Siehe auch ` typeInterpretation()`.

enum QPixelFormat::ColorModel

Diese Enumeration beschreibt die „ color model “ des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::RGB0Das Farbmodell ist RGB.
QPixelFormat::BGR1Logisch gesehen handelt es sich hierbei um die Endian-Version von RGB in umgekehrter Reihenfolge. Der Einfachheit halber verfügt es jedoch über ein eigenes Modell.
QPixelFormat::Indexed2Das Farbmodell verwendet eine Farbpalette.
QPixelFormat::Grayscale3Das Farbmodell ist Graustufen.
QPixelFormat::CMYK4Das Farbmodell ist CMYK.
QPixelFormat::HSL5Das Farbmodell ist HSL.
QPixelFormat::HSV6Das Farbmodell ist HSV.
QPixelFormat::YUV7Das Farbmodell ist YUV.
QPixelFormat::Alpha (since Qt 5.5)8Es gibt kein Farbmodell, es wird nur Alpha verwendet.

enum QPixelFormat::TypeInterpretation

Diese Enumeration beschreibt die „ type interpretation “ des Pixelformats.

KonstanteWertBeschreibung
QPixelFormat::UnsignedInteger0Die Pixel sollten als eine oder mehrere „ unsigned int “ gelesen werden.
QPixelFormat::UnsignedShort1Die Pixel sollten als eine oder mehrere „ unsigned short “ gelesen werden.
QPixelFormat::UnsignedByte2Die Pixel sollten als eine oder mehrere „ byte “ gelesen werden.
QPixelFormat::FloatingPoint3Die Pixel sollten als eine oder mehrere Gleitkommazahlen gelesen werden, wobei der konkrete Typ durch den Farb-/Alphakanal definiert wird, d. h. ` qfloat16 ` für 16-Bit-Half-Float-Formate und ` float ` für 32-Bit-Full-Float-Formate.

Siehe auch byteOrder().

enum QPixelFormat::YUVLayout

Diese Enumeration beschreibt die „ YUV layout “ des Pixelformats, vorausgesetzt, es verwendet das Farbmodell „ 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

Dokumentation der Mitgliedsfunktionen

[constexpr noexcept] QPixelFormat::QPixelFormat()

Erstellt ein Null-Pixelformat. Dieses Format entspricht „ QImage::Format_Invalid “.

[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)

Erstellt ein `QPixelFormat`, das seine Daten den Attributen zuordnet. ` colorModel ` wird in einen 4 Bit langen Puffer geschrieben.

firstSize secondSize thirdSize sollen alle die Größe eines Kanals darstellen. Die Kanäle werden je nach „ “ für unterschiedliche Zwecke verwendet. Bei RGB steht „firstSize“ für den Rotkanal. Bei CMYK steht es für den Wert des Cyan-Kanals. fourthSize fifthSize alphaSize colorModel

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 Gibt an, wie das Pixel interpretiert wird.

byteOrder Gibt die Endianness des Pixelformats an. Der Standardwert ist „ CurrentSystemEndian “, was bei nicht byte-geordneten Formaten auf die Endianness des Systems zurückgeführt wird, und „ QPixelFormat::BigEndian “ für „ QPixelFormat::UnsignedByte “.

subEnum Wird für Farbmodelle verwendet, die zusätzliche Informationen speichern müssen, indem eine zusätzliche Enumeration bereitgestellt wird. Dies wird von YUV verwendet, um den YUV-Typ zu speichern. Der Standardwert ist 0.

Hinweis: BGR-Formate verfügen über ein eigenes Farbmodell und sollten nicht unter Verwendung der umgekehrten 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 einzelnen Einheiten zugeordnet sind, ist die Alpha-Position relativ zu diesen Einheiten. Beispielsweise ist bei „ QImage::Format_RGBA16FPx4 “, das eine Alpha-Position von „ QPixelFormat::AtEnd “ hat, der Alpha-Wert der zuletzt gelesene Wert „ qfloat16 “.

Bei Formaten, bei denen mehrere Kanäle in einer einzigen Einheit zusammengefasst sind, werden die Werte ` QPixelFormat::AtBeginning ` und ` QPixelFormat::AtEnd ` den höchstwertigen und niedrigstwertigen Bits der zusammengefassten Einheit zugeordnet, bezogen auf die formatinterne ` byteOrder()`-Funktion.

Beispielsweise bedeutet bei „ QImage::Format_ARGB32 “, das eine Typinterpretation von „ QPixelFormat::UnsignedInteger “ und eine „ byteOrder()“ aufweist, die immer mit dem Host-System übereinstimmt, die Alpha-Position von „ QPixelFormat::AtBeginning “, dass das Alpha immer unter „ 0xFF000000 “ zu finden ist.

Wenn das Pixelformat und die Endianness des Hosts nicht übereinstimmen, muss darauf geachtet werden, das Layout des Pixelformats korrekt auf das Speicherlayout des Hosts abzubilden.

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 angibt, ob der Alphakanal verwendet wird oder nicht.

Manchmal reserviert das Pixelformat Platz für einen Alphakanal, sodass ` alphaSize()` einen Wert > 0 zurückgibt, der Alphakanal jedoch nicht verwendet bzw. ignoriert wird.

Beispielsweise beträgt bei „ QImage::Format_RGB32 “ der Wert von „ bitsPerPixel()“ 32, da der Alphakanal eine Größe von 8 hat, „alphaUsage()“ jedoch den Wert „ QPixelFormat::IgnoresAlpha “ zurückgibt.

Beachten Sie, dass in solchen Situationen die „ position “ des ungenutzten Alphakanals dennoch wichtig ist, da sie die Anordnung 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 plus die Größe des Alphakanals zurück.

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

Accessor-Funktion für den Schwarz-/Schlüssel-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 Byte-Reihenfolge des Pixelformats bestimmt die Speicheranordnung der einzelnen Typ-Einheiten, wie in der Funktion „ typeInterpretation()“ beschrieben.

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

Bei Pixelformaten mit typeInterpretation() QPixelFormat::UnsignedByte ist dies typischerweise QPixelFormat::BigEndian, während andere Typinterpretationen in der Regel die Endianness des aktuellen Systems widerspiegeln.

Wenn die Byte-Reihenfolge des Pixelformats mit der des aktuellen Systems übereinstimmt, können die einzelnen Typ-Einheiten mit denselben Bitmasken und Operationen gelesen und bearbeitet werden, unabhängig von der Endianness des Host-Systems. Bei „ QImage::Format_ARGB32 “ beispielsweise, das eine Typinterpretation vom Typ „ QPixelFormat::UnsignedInteger “ aufweist, kann der Alpha-Wert immer durch Maskieren des „ unsigned int “ mit „ 0xFF000000 “ gelesen werden, unabhängig von der Endianness des Host-Systems.

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

Siehe auch typeInterpretation() und alphaPosition().

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

Zugriffsfunktion für die Kanalanzahl.

Die Kanalanzahl gibt die Anzahl der Kanäle (Farbe und Alpha) mit einer Größe > 0 an.

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

Zugriffsfunktion für das Farbmodell.

Beachten Sie, dass bei „ QPixelFormat::YUV “ die einzelnen Makropixel nicht beschrieben werden können. Stattdessen wird eine Liste von „ YUV formats “ bereitgestellt, und der Wert von „ 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 Magenta-Farbkanal.

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

Accessor-Funktion, die angibt, ob der Alphakanal in die Farbkanäle eingerechnet 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 Typinterpretation legt fest, wie jedes Pixel ausgelesen werden soll.

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

Hinweis: Die byte order des Pixelformats und die Endianness des Hostsystems wirken sich nur auf die Speicheranordnung der einzelnen gelesenen Einheiten aus – nicht auf die relative Reihenfolge der Einheiten.

Beispielsweise hat „ QImage::Format_Mono “ eine „ pixel format “ von 1 Bit pro Pixel und eine Typinterpretation „ QPixelFormat::UnsignedByte “, die als einzelnes „ byte “ gelesen werden sollte. Ähnlich verhält es sich bei „ QImage::Format_RGB888 “ mit einer „ pixel format “ von 24 Bit pro Pixel und einer Typinterpretation „ QPixelFormat::UnsignedByte “, die als drei aufeinanderfolgende „ byte“ gelesen werden sollte.

Viele der QImage formats sind 32-Bit-Werte mit einer Typinterpretation von QPixelFormat::UnsignedInteger, die als 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-/Alpha-Kanäle bestimmt, wobei qfloat16 für 16-Bit-Half-Float-Formate und float für 32-Bit-Full-Float-Formate gilt.

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 die Anordnung der Pixel als Enumeration gespeichert.

Verwandte Nicht-Mitglieder

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

Konstruktorfunktion zum Erstellen 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, indem jedes Pixel mit Double-Werten beschrieben wird, 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 zum Erstellen von CMYK-Formaten. Die Anzahl der Kanäle beträgt 4 oder 5, 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 sowie sind alle über die gleichnamigen Zugriffsmethoden zugänglich. typeInterpretation

Siehe auch QPixelFormat::TypeInterpretation.

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

Konstruktorfunktion zum Erstellen eines Graustufenformats. Monochrome Formate lassen sich durch Übergabe des Werts 1 an „ channelSize “ beschreiben. Es ist auch möglich, sehr genaue Graustufenformate zu definieren, indem jedes Pixel mit Double-Werten beschrieben wird, indem man 8 als „ channelSize “ und „ FloatingPoint “ als „ typeInterpretation “ übergibt.

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 zum Erstellen von HSL-Formaten. Die Anzahl der Kanäle beträgt 3 oder 4, je nachdem, ob alphaSize größer als 0 ist.

channelSize Setzt die Werte für „ hueSize “, „ saturationSize “ und „ lightnessSize “ auf denselben Wert.

alphaUsage alphaPosition sowie sind alle über die gleichnamigen Zugriffsmethoden zugänglich. typeInterpretation

[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 zum Erstellen von HSV-Formaten. Die Anzahl der Kanäle beträgt 3 oder 4, je nachdem, ob alphaSize größer als 0 ist.

channelSize Setzt die Werte für „ hueSize “, „ saturationSize “ und „ brightnessSize “ auf denselben Wert.

alphaUsage alphaPosition sowie sind alle über die gleichnamigen Zugriffsmethoden zugänglich. typeInterpretation

[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 geben die Größe der einzelnen Farbkanäle an. alphaSize beschreibt die Größe des Alphakanals, dessen Position durch alphaPosition festgelegt wird. alphaUsage dient dazu, festzulegen, ob der Alphakanal verwendet wird oder nicht. Indem man die Größe des Alphakanals auf 8 und alphaUsage auf IgnoresAlpha setzt, lässt sich ein 32-Bit-Format erstellen, bei dem die RGB-Kanäle zusammen nur 24 Bit nutzen. 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 zum Erstellen eines „ QPixelFormat “, der ein YUV-Format mit „ yuvLayout “ beschreibt. „ alphaSize “ gibt die Größe eines möglichen Alphakanals an, dessen Position durch „ alphaPosition “ beschrieben wird. Die Kanäle „first“, „second“ … „fifth“ werden 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.