Übersicht über native Pixelformate
In diesem Thema werden die Pixelformate beschrieben, die von der Windows Imaging Component (WIC) bereitgestellt werden.
Ein Pixelformat beschreibt das Speicherlayout jedes Pixels in einer Bitmap. Dieses Speicherlayout beschreibt, wie die Bilddaten einer Bitmap codiert werden, indem das numerische Format und die Farbkanalorganisation angegeben werden. WIC unterstützt mehrere numerische Formate für mehrere Farbkanal-Organisationsschemas und bietet eine Vielzahl von Pixelformaten.
- Bittiefe
- Numerische Codierung
- Farbkanäle
- WIC-Pixelformat
- Farbraum
- Native Bildformate
- Nativer DDS-Codec
- Erweiterbarkeit des Pixelformats
- Zugehörige Themen
Bittiefe
Die Bittiefe ist die Anzahl der Bits, die zum Codieren der einzelnen Farbkanäle verwendet werden. Heutzutage verwenden die meisten digitalen Bilder eine Bittiefe von 8, was bedeutet, dass jeder Farbkanal in einem Pixel durch 8 Bits dargestellt wird und 2⁸ (256) eindeutige Werte pro Kanal bietet. Ein Bild mit einer Bittiefe von 8 und drei Farbkanälen (z. B. Rot, Grün und Blau) verwendet 24 Bits pro Pixel (bpp), wodurch 22⁴ (16.777.216) unterschiedliche Farben pro Pixel zur Verfügung steht.
Für eine bessere Farbauflösung kann eine Bittiefe von 16 oder 32 verwendet werden. Dadurch wird jedem Farbkanal ein eindeutiger Wert von 2.2⁶ (65.536) oder 2 . Dadurch wird mehr Arbeitsspeicher pro Pixel verwendet.
In einigen Formaten ist die Bittiefe kein Vielfaches von 8. Diese Formate werden als gepackte Formate bezeichnet, da die Farbkanäle in einem Pixel nicht an Bytegrenzen ausgerichtet sind. Wenn z. B. die Bittiefe von 5 ist, können drei Farbkanäle in 16 Bits gespeichert werden (einschließlich 1 Bit Auf padding, um Pixel bytebündig zu machen). Gepackte Formate sind nützlich, wenn der Arbeitsspeicher oder die Verarbeitungsleistung eingeschränkt ist.
Numerische Codierung
Für die meisten digitalen Bilder von heute werden unsignierte Bytes und kurze ganze Zahlen ohne Vorzeichen verwendet, um den numerischen Bereich jedes Farbkanals zu beschreiben. Der Mindestwert (0) stellt die Intensität 0 (null) in einem einzelnen Farbkanal dar, und Schwarz wird erreicht, wenn alle Farbkanäle 0 (null) sind. Ebenso stellt der Höchstwert die volle Intensität dar, und Weiß wird erreicht, wenn alle Farbkanäle mit voller Intensität sind. Bei einer Bittiefe von 8 stellt ein UINT 256 eindeutige Werte pro Farbkanal (0 -255) zurVerfingung. Ein 16-Bit-UINT stellt 65.536 eindeutige Werte pro Farbkanal (0 -65.535) zurVerfingung.
Darüber hinaus unterstützt WIC Festkomma- und Gleitkommaformate. Diese Formate unterstützen größere dynamische Bereiche, da der gesamte numerische Bereich jedes Farbkanals größer als der sichtbare Bereich ist. Daher können Farben während der Zwischenschritte der Bildverarbeitung über oder unterhalb des sichtbaren Bereichs angepasst werden, ohne dass Bildinformationen verloren geht.
Fixed-Point numerische Codierung
16-Bit-Festpunktwerte werden als s2.13 interpretiert: Vorzeichenbit, zwei ganzzahlige Bits und Bruchbruchbits. Verwenden Sie diese Interpretation, einen numerischen Bereich von –4,0 bis +3,999... kann mit dem Wert 1,0 dargestellt werden, der durch den ganzzahligen Wert mit Vorzeichen 8192 (0x2000) dargestellt wird.
32-Bit-Festpunktwerte werden als s7.24 interpretiert: Vorzeichenbit, sieben ganzzahlige Bits und 24 Bruchbits. Verwenden Sie diese Interpretation, einen numerischen Bereich von –128,0 bis +127,999... kann mit dem Wert 1,0 dargestellt werden, der durch den ganzzahligen Wert mit Vorzeichen 16777216 (0x01000000).
Farbkanäle
Die Farbkanäle eines Pixelformats definieren das Speicherlayout jeder Farbe innerhalb der Bilddaten einer Bitmap. Es gibt eine Vielzahl verschiedener Farbkanalstrukturen, die in den heutigen digitalen Bildern üblich sind, und WIC bietet Unterstützung für viele dieser Strukturen.
RGB/BGR-Farbmodell
RGB- und BGR-Formate beschreiben Farben in einem additiven Farbmodell. Die gängigste Methode zum Beschreiben eines Bilds ist mit drei separaten Farbkanälen, die die Farben Rot (R), Grün (G) und Blau (B) darstellen. WIC bietet Unterstützung für diese drei Kanäle in der Reihenfolge Rot-Grün-Blau (RGB) oder Blau-Grün-Rot (BGR). Dies ist die Reihenfolge, in der jeder Farbkanal innerhalb des sequenziellen Bitstreams angezeigt wird. Im GUID-Format _ WICPixelFormat32bppRGB ist jedes Pixel beispielsweise 32 Bit breit. Der rote Kanal ist das erste (am wenigsten signifikante) Byte im Arbeitsspeicher, gefolgt von grün und dann blau. Umgekehrt befinden sich die Farbkanäle im _ GUID-Format WICPixelFormat32bppBGR in umgekehrter Reihenfolge. WIC unterstützt eine Reihe von RGB/BGR-Formaten, einschließlich spezieller gepackter Bitformate wie GUID _ WICPixelFormat16bppBGR555.
Hinweis
Die Farbkanäle der speziellen BGR-gepackten Bitformate befinden sich nicht in Vielfachen von 8, wie die Farbkanäle in typischen Pixelformaten. Dies bedeutet, dass die Kanalwerte nicht bytebündig ausgerichtet sind. Beim Lesen gepackter Bitfarbkanäle ist Vorsicht zu geben.
Zusätzlich zu den RGB- und BGR-Formaten bietet WIC auch RGB- und BGR-Pixelformate, die einen Alphakanal (A) unterstützen. Der Alphakanal bietet Deckkraftdaten für das Pixel. Bei Formaten mit einem hinzugefügten Alphakanal ist der Alphakanal in der Regel der letzte in der Reihenfolge der Farbkanäle. Im Pixelformat GUID WICPixelFormat32bppBGRA ist die Byte reihenfolge beispielsweise blau, grün und rot, gefolgt vom _ Alphakanal.
WIC unterstützt auch vorab multiplizierte (P)-Alpha-RGB-Pixelformate. In einem typischen RGBA-Pixelformat sind die Farbwerte rot, grün und blau die tatsächlichen Farbwerte für das Bild. Um ein zusammengesetztes Bild im RGBA-Standardformat zu erstellen, muss der Alphawert des Vordergrundbilds mit jedem der roten, grünen und blauen Kanäle multipliziert werden, bevor er der Farbe des Hintergrundbilds hinzugefügt wird. In einem vorab multiplizierten RGB-Alphapixelformat wurde jeder Farbkanal bereits mit dem Alphawert multipliziert. Dies bietet eine effizientere Methode für die Bildkomposition mit Alphakanaldaten. Um die tatsächlichen Farbwerte jedes Kanals in einem PRGBA/PBGRA-Pixelformat abzurufen, muss die Alphakanal-Multiplikation umgekehrt werden, indem Farbwerte durch den Alphawert dividiert werden.
CFÄRB-Farbmodell
CTIVE ist ein subtraktives Farbmodell, das beim Drucken verwendet wird. Die von einem CIERTEN-Modell erzeugten Farben werden durch das Licht generiert, das nicht generiert, sondern reflektiert wird. CSTELLUNG ist ein Vierkanalmodell von Cyan (C), Magenta (M), Gelb (Y) und Schwarz (K). Wenn alle vier Farbkanäle den maximal zulässigen Wert haben, ist das Ergebnis schwarz. Wie bei den RGB/BGR-Farbmodellen wird die Byte reihenfolge innerhalb des sequenziellen Bitstreams durch den Namen des Pixelformats angegeben. Beispielsweise besteht jedes Pixel im Pixelformat GUID _ WICPixelFormat32bppCXEL aus 32 Bits. Das erste Byte enthält den Zyanwert, gefolgt von Magenta, Gelb und Schwarz. WIC stellt Pixelformate für CVP mit 32 und 64 Bits pro Pixel (bpp) zur Verfügung.
Zusätzlich zum CREA-Standardfarbmodell stellt WIC auch CSIS mit Alpha zur Verfügung. Auf diese Weise können CMIX-Bilder Alphablendingdaten enthalten, die dem RGB/BGR-Farbmodell ähneln. Der Alphakanal befindet sich unmittelbar nach Schwarz im sequenziellen Bitstream einer Bitmap.
n-Kanal-Farbmodell
Aus Flexibilitätsgewöhnung bietet WIC auch Pixelformate, die keine vordefinierte Kanal reihenfolge haben. WIC bietet Pixelformate, die zwischen drei und acht Kanäle kontinuierlicher Bilddaten in Bittiefe von 8 und 16 unterstützen. Im Gegensatz zu den RGB-/BGR- und CMYK-Pixelformaten geben n-Kanalformate nicht die Kanalreihenfolge an, sondern die Anzahl der verfügbaren Farbkanäle. Beispielsweise besteht jedes Pixel im Pixelformat GUID _ WICPixelFormat32bpp4Channels aus 32 Bits, wobei jeder der vier Kanäle ein einzelnes Byte belegt.
WIC stellt auch Pixelformate für n-Kanal mit Alpha bereit. Dadurch können n-Kanalbilder alphanumerische Daten aufweisen, die den RGB-/BGR- und CMYK-Farbmodellen ähneln. Der Alphakanal befindet sich unmittelbar nach dem letzten Farbkanal im sequenziellen Bitstream einer Bitmap.
Indizierte und Graustufenfarbmodelle
Indizierte Formate verwenden eine Tabelle mit Farben, die als Palette bezeichnet wird. Die Palette wird extern für die Pixeldaten gespeichert oder implizit definiert. Der Wert jedes Pixels im Bild ist ein Index in der Palette. Bei einem indizierten Format hängt die Anzahl der Bits pro Pixel direkt mit der Anzahl der Einträge in der Palette zusammen. Dadurch wird die Datenmenge, die zum Darstellen des Bilds erforderlich ist, erheblich reduziert, aber auch die Anzahl der für das Bild verfügbaren Farben eingeschränkt. WIC unterstützt indizierte Formate mit 1, 2, 4 oder 8 BPP.
Für Monocolore-Formate (Graustufen) unterstützt WIC 1, 2, 4, 8, 16 und 32 Bits pro Pixel. Bei Bittiefe von 1, 8, 16 und 32 werden die Farbdaten in einem einzigen Kanal gespeichert. Bei Bittiefe von 2 oder 4 sind Pixel Indizes in einer Graustufenpalette.
Y'CbCr-Farbmodell
WIC fügt Unterstützung für das JPEG JFIF Y'CbCr-Farbmodell hinzu. Y'CbCr trennt Farben in eine Lumakomponente (Y') und zwei Komponenten (Cb und Cr). Viele JPEG-Dateien speichern Bilddaten nativ mithilfe des Y'CbCr-Farbmodells.
Das menschliche visuelle System reagiert weniger empfindlich auf Änderungen in der Färbung als auf Luma, und Y'CbCr-Formate können von dieser geringeren Empfindlichkeit profitieren, indem sie die Menge der Imkdaten reduzieren, die relativ zu luma gespeichert werden. Sie erreichen dies, indem sie "luma" und "luma" in separaten Ebenen speichern und jede Komponentenebene auf eine andere Auflösung skalieren. Diese Vorgehensweise wird als Subsampling für Diensampling bezeichnet.
Da Die Luma- und Luma-Daten separat gespeichert werden und unterschiedliche Auflösungen aufweisen können, definiert WIC separate Luma- und Pixelformate für Pixel. WIC unterstützt Daten mit 8 Bits pro Kanal.
WIC-Pixelformat
Die Pixelformate in WIC werden mithilfe von GUIDs definiert, um Konflikte mit IHVs zu vermeiden. WIC stellt einen Anzeigenamen bereit, um auf die GUID eines nativen Pixelformats zu verweisen. Die Benennungskonvention für die WIC-Pixelformate lautet wie folgt:
[GUID _ WICPixelFormat ] [ Bits Per Pixel ] [ Channel Order Storage ] [ Type]
| Formatkomponente | BESCHREIBUNG |
|---|---|
| GUID _ WICPixelFormat | Die beschreibende Identifikation für alle WIC-Pixelformate. Der Anzeigename für alle WIC-Pixel beginnt mit dieser Zeichenfolge. |
| Bits pro Pixel | Die Anzahl der Bits pro Pixel (bpp), die für das Pixelformat verwendet werden. |
| Kanalreihenfolge | Das Farbkanalmodell und die Reihenfolge der einzelnen Kanäle für das Format. |
| Speichertyp | Die numerische Codierung, die für das Pixelformat verwendet wird. Die Standardcodierung ist eine ganze Zahl ohne Vorzeichen. Wenn den Farbmodellinformationen nichts folgt, wird eine ganze Zahl ohne Vorzeichen (UINT) impliziert. FixedPoint und Float werden verwendet, um Pixelformate zu identifizieren, die Festkomma- bzw. Gleitkommacodierung verwenden. |
Hinweis
Bei n-Kanal-Formaten [ gibt die Kanalreihenfolge ] nicht die Farbreihenfolge an, sondern die Anzahl der verfügbaren Kanäle. Beispielsweise stellt GUID _ WICPixelFormat24bpp3Channels drei Farbkanäle bereit, wobei "3Channels" der [ Eintrag ] Kanalreihenfolge ist, aber nur die Anzahl der Kanäle und nicht die Reihenfolge angibt.
Der Anzeigename GUID _ WICPixelFormat24bppRGB bedeutet beispielsweise, dass das Pixelformat 24 Bit pro Pixel und das RGB-Farbmodell verwendet. Da der Name einen Speichertyp nicht explizit identifiziert, wird eine ganze Zahl ohne Vorzeichen impliziert.
WIC unterstützt mehrere Pixelformate. In den folgenden Tabellen werden ähnliche Pixelformate nach Farbstruktur gruppiert, während zusätzliche Informationen wie Bittiefe, Bits pro Pixel und numerische Codierung angegeben werden. Jede Tabelle enthält die folgenden Informationen:
- Anzeigename. Der Anzeigename des Pixelformats.
- Kanalanzahl. Die Anzahl der Farbkanäle.
- Bits pro Kanal. Die Anzahl der Bits pro Kanal (Bittiefe).
- Bits pro Pixel. Die Anzahl der Bits pro Pixel, einschließlich aller Auffüllungsbits.
- Storage Geben Sie ein. Die numerische Codierung der Bilddaten. Dieser Wert kann eine ganze Zahl ohne Vorzeichen (UINT), eine Festkommazahl (FixedPoint) oder eine Gleitkommazahl (Float) sein.
Hinweis
Aus Gründen der Übersichtlichkeit bezieht sich dieses Dokument nur anhand ihrer Anzeigenamen auf Pixelformate. Den tatsächlichen Hexadezimalwert für die Pixelformate finden Sie in den Wincodec.h/idl-Dateien.
Nicht definierte Pixelformate
Die folgende Liste zeigt generische Pixelformate, die verwendet werden, wenn das Pixelformat nicht definiert ist oder für einen Bildvorgang unwichtig ist.
- GUID _ WICPixelFormatUndefined
- GUID _ WICPixelFormatDontCare
Indizierte Pixelformate
In der folgenden Tabelle sind die von WIC bereitgestellten indizierten Pixelformate aufgeführt. In diesen Formaten ist der Wert für jedes Pixel ein Index in einer Farbpalette.
| Anzeigename | Kanalanzahl | Bits pro Pixel | Speichertyp |
|---|---|---|---|
| GUID _ WICPixelFormat1bppIndexed | 1 | 1 | UINT |
| GUID _ WICPixelFormat2bppIndexed | 1 | 2 | UINT |
| GUID _ WICPixelFormat4bppIndexed | 1 | 4 | UINT |
| GUID _ WICPixelFormat8bppIndexed | 1 | 8 | UINT |
Gepackte Bitpixelformate
In der folgenden Tabelle sind die von WIC bereitgestellten gepackten Bitformate aufgeführt. In diesen Formaten werden Farbkanaldaten nicht bytebündig ausgerichtet.
| Anzeigename | Kanalanzahl | Bits pro Kanal | Bits pro Pixel | Speichertyp |
|---|---|---|---|---|
| GUID _ WICPixelFormat16bppBGR555 | 3 | 5 | 16 | UINT |
| GUID _ WICPixelFormat16bppBGR565 | 3 | 5(B)/6(G)/5(R) | 16 | UINT |
| GUID _ WICPixelFormat16bppBGRA555 | 4 | 5(B)/5(G)/5(R)/1(A) | 16 | UINT |
| GUID _ WICPixelFormat32bppBGR101010 | 3 | 10 | 32 | UINT |
| GUID _ WICPixelFormat32bppRGBA1010102 | 4 | 10(R)/10(G)/10(B)/2(A) | 32 | UINT |
| GUID _ WICPixelFormat32bppRGBA1010102XR | 4 | 10(R)/10(G)/10(B)/2(A) | 32 | UINT |
| GUID _ WICPixelFormat32bppR10G10B10A2 | 4 | 10(R)/10(G)/10(B)/2(A) | 32 | UINT |
| GUID _ WICPixelFormat32bppR10G10B10A2HDR10 | 4 | 10(R)/10(G)/10(B)/2(A) | 32 | UINT |
Für die Formate GUID _ WICPixelFormat32bppBGR101010 und GUID _ WICPixelFormat32bppRGBA1010102 wird der rote Kanal in den am wenigsten wichtigen Bits gespeichert. Für die Formate GUID _ WICPixelFormat32bppR10G10B10A2 und GUID _ WICPixelFormat32bppR10G10B10A2HDR10 wird der rote Kanal in den wichtigsten Bits definiert, dasselbe Layout wie DXGI_FORMAT_R10G10B10A2_UNORM.
Das _ GUID-Format WICPixelFormat32bppR10G10B10A2HDR10 ist das 10-Bit-Pixelformat für HDR10 (BT.2020-Farbraum und SMPTE ST.2084 EOTF).
Graustufenpixelformate
In der folgenden Tabelle sind die Graustufenformate aufgeführt, die von WIC bereitgestellt werden. In diesen Formaten stellen Farbdaten Graustufen dar.
| Anzeigename | Kanalanzahl | Bits pro Kanal | Bits pro Pixel | Speichertyp |
|---|---|---|---|---|
| GUID _ WICPixelFormatBlackWhite | 1 | 1 | 1 | UINT |
| GUID _ WICPixelFormat2bppGray | 1 | 2 | 2 | UINT |
| GUID _ WICPixelFormat4bppGray | 1 | 4 | 4 | UINT |
| GUID _ WICPixelFormat8bppGray | 1 | 8 | 8 | UINT |
| GUID _ WICPixelFormat16bppGray | 1 | 16 | 16 | UINT |
| GUID _ WICPixelFormat16bppGrayFixedPoint | 1 | 16 | 16 | FixedPoint |
| GUID _ WICPixelFormat16bppGrayHalf | 1 | 16 | 16 | Float |
| GUID _ WICPixelFormat32bppGrayFloat | 1 | 32 | 32 | Float |
| GUID _ WICPixelFormat32bppGrayFixedPoint | 1 | 32 | 32 | FixedPoint |
RGB/BGR-Pixelformate
In der folgenden Tabelle sind die RGB/BGR-Formate aufgeführt, die von WIC bereitgestellt werden. Diese Formate trennen die Primärfarbdaten in die Kanäle Rot (R), Grün (G) und Blau (B). Für Deckkraftinformationen in einigen Formaten wird ein zusätzlicher Alphakanal (A) bereitgestellt.
| Anzeigename | Kanalanzahl | Bits pro Kanal | Bits pro Pixel | Speichertyp |
|---|---|---|---|---|
| GUID _ WICPixelFormat24bppRGB | 3 | 8 | 24 | UINT |
| GUID _ WICPixelFormat24bppBGR | 3 | 8 | 24 | UINT |
| GUID _ WICPixelFormat32bppBGR | 3 | 8 | 32 | UINT |
| GUID _ WICPixelFormat32bppRGBA | 4 | 8 | 32 | UINT |
| GUID _ WICPixelFormat32bppBGRA | 4 | 8 | 32 | UINT |
| GUID _ WICPixelFormat32bppRGBE* | 4 | 8 | 32 | Float |
| GUID _ WICPixelFormat32bppPRGBA | 4 | 8 | 32 | UINT |
| GUID _ WICPixelFormat32bppPBGRA | 4 | 8 | 32 | UINT |
| GUID _ WICPixelFormat48bppRGB | 3 | 16 | 48 | UINT |
| GUID _ WICPixelFormat48bppBGR | 3 | 16 | 48 | UINT |
| GUID _ WICPixelFormat48bppRGBFixedPoint | 3 | 16 | 48 | Fest |
| GUID _ WICPixelFormat48bppBGRFixedPoint | 3 | 16 | 48 | Fest |
| GUID _ WICPixelFormat48bppRGBHalf | 3 | 16 | 48 | Float |
| GUID _ WICPixelFormat64bppRGBA | 4 | 16 | 64 | UINT |
| GUID _ WICPixelFormat64bppBGRA | 4 | 16 | 64 | UINT |
| GUID _ WICPixelFormat64bppPRGBA | 4 | 16 | 64 | UINT |
| GUID _ WICPixelFormat64bppPBGRA | 4 | 16 | 64 | UINT |
| GUID _ WICPixelFormat64bppRGBFixedPoint | 3 | 16 | 64 | Fest |
| GUID _ WICPixelFormat64bppRGBAFixedPoint | 4 | 16 | 64 | Fest |
| GUID _ WICPixelFormat64bppBGRAFixedPoint | 4 | 16 | 64 | Fest |
| GUID _ WICPixelFormat64bppRGBHalf | 3 | 16 | 64 | Float |
| GUID _ WICPixelFormat64bppRGBAHalf | 4 | 16 | 64 | Float |
| GUID _ WICPixelFormat96bppRGBFixedPoint | 3 | 32 | 96 | Fest |
| GUID _ WICPixelFormat128bppRGBFloat | 3 | 32 | 128 | Float |
| GUID _ WICPixelFormat128bppRGBAFloat | 4 | 32 | 128 | Float |
| GUID _ WICPixelFormat128bppPRGBAFloat | 4 | 32 | 128 | Float |
| GUID _ WICPixelFormat128bppRGBFixedPoint | 3 | 32 | 128 | Fest |
| GUID _ WICPixelFormat128bppRGBAFixedPoint | 4 | 32 | 128 | Fest |
Hinweis
*Das GUID _ WICPixelFormat32bppRGBE-Format codiert drei 16-Bit-Gleitkommawerte in 4 Bytes wie folgt: Drei 8-Bit-Mantisse ohne Vorzeichen für die R-, G- und B-Kanäle sowie einen freigegebenen 8-Bit-Exponenten. Dieses Format bietet 16-Bit-Gleitkommagenauigkeit in einer kleineren Pixeldarstellung.
Ab Windows 8 und dem Plattformupdate für Windows 7bietet WIC zusätzliche Formate, wie in der tabelle hier gezeigt.
| Anzeigename | Kanalanzahl | Bits pro Kanal | Bits pro Pixel | Speichertyp |
|---|---|---|---|---|
| GUID _ WICPixelFormat32bppRGB | 3 | 8 | 32 | UINT |
| GUID _ WICPixelFormat64bppRGB | 3 | 16 | 64 | UINT |
| GUID _ WICPixelFormat96bppRGBFloat | 3 | 32 | 96 | GLEITKOMMAZAHL |
| GUID _ WICPixelFormat64bppPRGBAHalf | 4 | 16 | 64 | GLEITKOMMAZAHL |
CMYK-Pixelformate
In der folgenden Tabelle sind die von WIC bereitgestellten CMYK-Formate aufgeführt. Diese Formate trennen die Primären Farbdaten in Cyan-Kanäle (C), Magenta-Kanäle (M), gelben (Y) und schwarzen Kanälen (K).
| Anzeigename | Kanalanzahl | Bits pro Kanal | Bits pro Pixel | Speichertyp |
|---|---|---|---|---|
| GUID _ WICPixelFormat32bppCMYK | 4 | 8 | 32 | UINT |
| GUID _ WICPixelFormat64bppCMYK | 4 | 16 | 64 | UINT |
| GUID _ WICPixelFormat40bppCMYKAlpha | 5 | 8 | 40 | UINT |
| GUID _ WICPixelFormat80bppCMYKAlpha | 5 | 16 | 80 | UINT |
N-Kanal-Pixelformate
In der folgenden Tabelle sind die von WIC bereitgestellten n-kanal-Formate aufgeführt. Diese Formate stellen eine Reihe von nicht definierten Farbkanälen zum Speichern von Bilddaten zur Verfügung.
| Anzeigename | Kanalanzahl | Bits pro Kanal | Bits pro Pixel | Speichertyp |
|---|---|---|---|---|
| GUID _ WICPixelFormat24bpp3Channels | 3 | 8 | 24 | UINT |
| GUID _ WICPixelFormat48bpp3Channels | 3 | 16 | 48 | UINT |
| GUID _ WICPixelFormat32bpp3ChannelsAlpha | 4 | 8 | 32 | UINT |
| GUID _ WICPixelFormat64bpp3ChannelsAlpha | 4 | 16 | 64 | UINT |
| GUID _ WICPixelFormat32bpp4Channels | 4 | 8 | 32 | UINT |
| GUID _ WICPixelFormat64bpp4Channels | 4 | 16 | 64 | UINT |
| GUID _ WICPixelFormat40bpp4ChannelsAlpha | 5 | 8 | 40 | UINT |
| GUID _ WICPixelFormat80bpp4ChannelsAlpha | 5 | 16 | 80 | UINT |
| GUID _ WICPixelFormat40bpp5Channels | 5 | 8 | 40 | UINT |
| GUID _ WICPixelFormat80bpp5Channels | 5 | 16 | 80 | UINT |
| GUID _ WICPixelFormat48bpp5ChannelsAlpha | 6 | 8 | 48 | UINT |
| GUID _ WICPixelFormat96bpp5ChannelsAlpha | 6 | 16 | 96 | UINT |
| GUID _ WICPixelFormat48bpp6Channels | 6 | 8 | 48 | UINT |
| GUID _ WICPixelFormat96bpp6Channels | 6 | 16 | 96 | UINT |
| GUID _ WICPixelFormat56bpp6ChannelsAlpha | 7 | 8 | 56 | UINT |
| GUID _ WICPixelFormat112bpp6ChannelsAlpha | 7 | 16 | 112 | UINT |
| GUID _ WICPixelFormat56bpp7Channels | 7 | 8 | 56 | UINT |
| GUID _ WICPixelFormat112bpp7Channels | 7 | 16 | 112 | UINT |
| GUID _ WICPixelFormat64bpp7ChannelsAlpha | 8 | 8 | 64 | UINT |
| GUID _ WICPixelFormat128bpp7ChannelsAlpha | 8 | 16 | 128 | UINT |
| GUID _ WICPixelFormat64bpp8Channels | 8 | 8 | 64 | UINT |
| GUID _ WICPixelFormat128bpp8Channels | 8 | 16 | 128 | UINT |
| GUID _ WICPixelFormat72bpp8ChannelsAlpha | 9 | 8 | 72 | UINT |
| GUID _ WICPixelFormat144bpp8ChannelsAlpha | 9 | 16 | 144 | UINT |
Nur Alphapixelformate
In der folgenden Tabelle sind die von WIC bereitgestellten Alpha-Only-Formate aufgeführt. Dieses Format enthält nur Alphainformationen.
| Anzeigename | Kanalanzahl | Bits pro Kanal | Bits pro Pixel | Speichertyp |
|---|---|---|---|---|
| GUID _ WICPixelFormat8bppAlpha | 1 | 8 | 32 | UINT |
Y'CbCr-Pixelformate
In der folgenden Tabelle sind die von WIC bereitgestellten Y'CbCr-Formate aufgeführt. Diese Formate trennen die primären Farbdaten in Luma (Y), blauer Farbunterschied (Cb) und roter Chomaunterschied (Cr). Beachten Sie, dass diese Formate zum Speichern von JPEG JFIF Y'CbCr-Pixeldaten konzipiert sind.
| Anzeigename | Kanalanzahl | Bits pro Pixel | Speichertyp |
|---|---|---|---|
| GUID _ WICPixelFormat8bppY | 1 | 8 | UINT |
| GUID _ WICPixelFormat8bppCb | 1 | 8 | UINT |
| GUID _ WICPixelFormat8bppCr | 1 | 8 | UINT |
| GUID _ WICPixelFormat16bppCbCr | 2 | 16 | UINT |
Farbraum
Pixelformate selbst verfügen nicht über einen Farbraum. Im Allgemeinen ist der Farbraum eine semantische Interpretation der Pixelwerte, die vom Kontext der Bitmap abhängig ist. Einige Bilder identifizieren einen Farbkontext, der den Farbraum des Bilds definiert. Nur wenn kein Farbkontext vorhanden ist, sollte der Farbraum abgeleitet werden.
Farbkontextinformationen werden von der IWICColorContext-Schnittstelle für WIC definiert. Verwenden Sie die GetColorContext-Methode, um die Farbkontextinformationen für einen Bildrahmen abzurufen.
Wenn keine Farbrauminformationen für ein Bild vorhanden sind, besteht die allgemeine Regel für Farbraumrückschluss darin, dass UINT RGB- und Graustufenformate den standardmäßigen RGB-Farbraum (sRGB) verwenden, während rgb- und graue Formate mit Festkomma- und Gleitkommawerten den erweiterten RGB-Farbraum (scRGB) verwenden. Das CMYK-Farbmodell verwendet einen RWOP-Farbraum.
Native Imageformate
Jeder der Windows bereitgestellten WIC-Codecs unterstützt eine Teilmenge der WIC-Pixelformate. Für jeden Codec können sich die unterstützten Decodierungsformate von den unterstützten Codierungsformaten unterscheiden.
Wenn Daten beim Decodieren eines Bilds nativ in einem Pixelformat gespeichert werden, das vom Decoder nicht unterstützt wird, werden sie in ein unterstütztes Format konvertiert. Um das Ausgabepixelformat zu bestimmen, rufen Sie IWICBitmapFrameDecode::GetPixelFormatauf.
Verwenden Sie beim Codieren eines Bilds IWICBitmapFrameEncode::SetPixelFormat, um anzufordern, dass der Encoder ein bestimmtes Pixelformat verwendet. Der Encoder gibt das nächstgelegene unterstützte Pixelformat zurück, das sich möglicherweise von dem unterscheidet, was angefordert wurde.
Die folgenden Tabellen zeigen die Pixelformate, die von jedem der Windows bereitgestellten WIC-Codecs unterstützt werden.
Nativer BMP-Codec
| Decoderpixelformate | Encoderpixelformate |
|---|---|
| GUID _ WICPixelFormat1bppIndexed | GUID _ WICPixelFormat1bppIndexed |
| GUID _ WICPixelFormat4bppIndexed | GUID _ WICPixelFormat4bppIndexed |
| GUID _ WICPixelFormat8bppIndexed | GUID _ WICPixelFormat8bppIndexed |
| GUID _ WICPixelFormat16bppBGR555 | GUID _ WICPixelFormat16bppBGR555 |
| GUID _ WICPixelFormat16bppBGR565 | GUID _ WICPixelFormat16bppBGR565 |
| GUID _ WICPixelFormat24bppBGR | GUID _ WICPixelFormat24bppBGR |
| GUID _ WICPixelFormat32bppBGR | GUID _ WICPixelFormat32bppBGR |
| GUID _ WICPixelFormat32bppBGRA* | GUID _ WICPixelFormat32bppBGRA* |
| GUID _ WICPixelFormat64bppRGBAFixedPoint | GUID _ WICPixelFormat32bppPBGRA |
| GUID _ WICPixelFormat64bppRGBAFixedPoint | |
| GUID _ WICPixelFormat64bppBGRAFixedPoint |
Hinweis
GUID _ WICPixelFormat32bppBGRA wird nur in Windows 8, dem Plattformupdate für Windows 7und höher unterstützt.
- Verwenden Sie zum Codieren in dieses Format die Encoderoption EnableV5Header32bppBGRA. Der BMP wird mit einem BITMAPV5HEADER-Header geschrieben.
- Wenn eine Datei über einen BITMAPV5HEADER verfügt, decodiert sie als GUID _ WICPixelFormat32bppBGRA.
Nativer GIF-Codec
| Decoderpixelformate | Encoder-Pixelformate |
|---|---|
| GUID _ WICPixelFormat8bppIndexed | GUID _ WICPixelFormat8bppIndexed |
Nativer ICO-Codec
| Decoderpixelformate | Encoder-Pixelformate |
|---|---|
| GUID _ WICPixelFormat32bppBGRA |
JPEG Native Codec
| Decoderpixelformate | Encoder-Pixelformate |
|---|---|
| GUID _ WICPixelFormat8bppGray | GUID _ WICPixelFormat8bppGray |
| GUID _ WICPixelFormat24bppBGR | GUID _ WICPixelFormat24bppBGR |
| GUID _ WICPixelFormat32bppC JPG | GUID _ WICPixelFormat32bppC JPG |
PNG Native Codec
| Decoderpixelformate | Encoder-Pixelformate |
|---|---|
| GUID _ WICPixelFormat1bppIndexed | GUID _ WICPixelFormat1bppIndexed |
| GUID _ WICPixelFormat2bppIndexed | GUID _ WICPixelFormat2bppIndexed |
| GUID _ WICPixelFormat4bppIndexed | GUID _ WICPixelFormat4bppIndexed |
| GUID _ WICPixelFormat8bppIndexed | GUID _ WICPixelFormat8bppIndexed |
| GUID _ WICPixelFormatBlackWhite | GUID _ WICPixelFormatBlackWhite |
| GUID _ WICPixelFormat2bppGray | GUID _ WICPixelFormat2bppGray |
| GUID _ WICPixelFormat4bppGray | GUID _ WICPixelFormat4bppGray |
| GUID _ WICPixelFormat8bppGray | GUID _ WICPixelFormat8bppGray |
| GUID _ WICPixelFormat16bppGray | GUID _ WICPixelFormat16bppGray |
| GUID _ WICPixelFormat24bppBGR | GUID _ WICPixelFormat24bppBGR |
| GUID _ WICPixelFormat32bppBGRA | GUID _ WICPixelFormat32bppBGRA |
| GUID _ WICPixelFormat48bppRGB | GUID _ WICPixelFormat48bppRGB |
| GUID _ WICPixelFormat64bppRGBA | GUID _ WICPixelFormat48bppBGR |
| GUID _ WICPixelFormat64bppRGBA | |
| GUID _ WICPixelFormat64bppBGRA |
Nativer TIFF-Codec
| Decoderpixelformate | Encoder-Pixelformate |
|---|---|
| GUID _ WICPixelFormat1bppIndexed | GUID _ WICPixelFormat1bppIndexed |
| GUID _ WICPixelFormat4bppIndexed | GUID _ WICPixelFormat4bppIndexed |
| GUID _ WICPixelFormat8bppIndexed | GUID _ WICPixelFormat8bppIndexed |
| GUID _ WICPixelFormatBlackWhite | GUID _ WICPixelFormatBlackWhite |
| GUID _ WICPixelFormat4bppGray | GUID _ WICPixelFormat4bppGray |
| GUID _ WICPixelFormat8bppGray | GUID _ WICPixelFormat8bppGray |
| GUID _ WICPixelFormat16bppGray | GUID _ WICPixelFormat16bppGray |
| GUID _ WICPixelFormat32bppGrayFloat | GUID _ WICPixelFormat24bppBGR |
| GUID _ WICPixelFormat24bppBGR | GUID _ WICPixelFormat32bppBGRA |
| GUID _ WICPixelFormat32bppBGRA | GUID _ WICPixelFormat32bppC JPG |
| GUID _ WICPixelFormat32bppPBGRA | GUID _ WICPixelFormat48bppRGB |
| GUID _ WICPixelFormat48bppRGB | GUID _ WICPixelFormat64bppRGBA |
| GUID _ WICPixelFormat32bppC JPG | |
| GUID _ WICPixelFormat40bppCLANGAlpha | |
| GUID _ WICPixelFormat64bppRGBA | |
| GUID _ WICPixelFormat64bppPRGBA | |
| GUID _ WICPixelFormat64bppC JPG | |
| GUID _ WICPixelFormat80bppCLANGAlpha | |
| GUID _ WICPixelFormat96bppRGBFloat* | |
| GUID _ WICPixelFormat128bppRGBAFloat | |
| GUID _ WICPixelFormat128bppPRGBAFloat |
Hinweis
GUID _ WICPixelFormat96bppRGBFloat wird nur in Windows 8, dem Plattformupdate für Windows 7und höher unterstützt.
JPEG-XR Native Codec
| Decoderpixelformate | Encoder-Pixelformate |
|---|---|
| GUID _ WICPixelFormatBlackWhite | GUID _ WICPixelFormatBlackWhite |
| GUID _ WICPixelFormat8bppGray | GUID _ WICPixelFormat8bppGray |
| GUID _ WICPixelFormat16bppBGR555 | GUID _ WICPixelFormat16bppBGR555 |
| GUID _ WICPixelFormat16bppGray | GUID _ WICPixelFormat16bppGray |
| GUID _ WICPixelFormat24bppBGR | GUID _ WICPixelFormat24bppBGR |
| GUID _ WICPixelFormat24bppRGB | GUID _ WICPixelFormat24bppRGB |
| GUID _ WICPixelFormat32bppBGR | GUID _ WICPixelFormat32bppBGR |
| GUID _ WICPixelFormat32bppBGRA | GUID _ WICPixelFormat32bppBGRA |
| GUID _ WICPixelFormat48bppRGBFixedPoint | GUID _ WICPixelFormat48bppRGBFixedPoint |
| GUID _ WICPixelFormat16bppGrayFixedPoint | GUID _ WICPixelFormat16bppGrayFixedPoint |
| GUID _ WICPixelFormat32bppBGR101010 | GUID _ WICPixelFormat32bppBGR101010 |
| GUID _ WICPixelFormat48bppRGB | GUID _ WICPixelFormat48bppRGB |
| GUID _ WICPixelFormat64bppRGBA | GUID _ WICPixelFormat64bppRGBA |
| GUID _ WICPixelFormat96bppRGBFixedPoint | GUID _ WICPixelFormat96bppRGBFixedPoint |
| GUID _ WICPixelFormat96bppRGBFixedPoint | GUID _ WICPixelFormat128bppRGBAFloat |
| GUID _ WICPixelFormat128bppRGBFloat | GUID _ WICPixelFormat128bppRGBFloat |
| GUID _ WICPixelFormat32bppCMYK | GUID _ WICPixelFormat32bppCMYK |
| GUID _ WICPixelFormat64bppRGBAFixedPoint | GUID _ WICPixelFormat64bppRGBAFixedPoint |
| GUID _ WICPixelFormat128bppRGBAFixedPoint | GUID _ WICPixelFormat128bppRGBAFixedPoint |
| GUID _ WICPixelFormat64bppCMYK | GUID _ WICPixelFormat64bppCMYK |
| GUID _ WICPixelFormat24bpp3Channels | GUID _ WICPixelFormat24bpp3Channels |
| GUID _ WICPixelFormat32bpp4Channels | GUID _ WICPixelFormat32bpp4Channels |
| GUID _ WICPixelFormat40bpp5Channels | GUID _ WICPixelFormat40bpp5Channels |
| GUID _ WICPixelFormat48bpp6Channels | GUID _ WICPixelFormat48bpp6Channels |
| GUID _ WICPixelFormat56bpp7Channels | GUID _ WICPixelFormat56bpp7Channels |
| GUID _ WICPixelFormat64bpp8Channels | GUID _ WICPixelFormat64bpp8Channels |
| GUID _ WICPixelFormat48bpp3Channels | GUID _ WICPixelFormat48bpp3Channels |
| GUID _ WICPixelFormat64bpp4Channels | GUID _ WICPixelFormat64bpp4Channels |
| GUID _ WICPixelFormat80bpp5Channels | GUID _ WICPixelFormat80bpp5Channels |
| GUID _ WICPixelFormat96bpp6Channels | GUID _ WICPixelFormat96bpp6Channels |
| GUID _ WICPixelFormat112bpp7Channels | GUID _ WICPixelFormat112bpp7Channels |
| GUID _ WICPixelFormat128bpp8Channels | GUID _ WICPixelFormat128bpp8Channels |
| GUID _ WICPixelFormat40bppCMYKAlpha | GUID _ WICPixelFormat40bppCMYKAlpha |
| GUID _ WICPixelFormat80bppCMYKAlpha | GUID _ WICPixelFormat80bppCMYKAlpha |
| GUID _ WICPixelFormat32bpp3ChannelsAlpha | GUID _ WICPixelFormat32bpp3ChannelsAlpha |
| GUID _ WICPixelFormat64bpp7ChannelsAlpha | GUID _ WICPixelFormat40bpp4ChannelsAlpha |
| GUID _ WICPixelFormat72bpp8ChannelsAlpha | GUID _ WICPixelFormat48bpp5ChannelsAlpha |
| GUID _ WICPixelFormat64bpp3ChannelsAlpha | GUID _ WICPixelFormat56bpp6ChannelsAlpha |
| GUID _ WICPixelFormat80bpp4ChannelsAlpha | GUID _ WICPixelFormat64bpp7ChannelsAlpha |
| GUID _ WICPixelFormat96bpp5ChannelsAlpha | GUID _ WICPixelFormat72bpp8ChannelsAlpha |
| GUID _ WICPixelFormat112bpp6ChannelsAlpha | GUID _ WICPixelFormat64bpp3ChannelsAlpha |
| GUID _ WICPixelFormat128bpp7ChannelsAlpha | GUID _ WICPixelFormat80bpp4ChannelsAlpha |
| GUID _ WICPixelFormat144bpp8ChannelsAlpha | GUID _ WICPixelFormat96bpp5ChannelsAlpha |
| GUID _ WICPixelFormat64bppRGBAHalf | GUID _ WICPixelFormat112bpp6ChannelsAlpha |
| GUID _ WICPixelFormat48bppRGBHalf | GUID _ WICPixelFormat128bpp7ChannelsAlpha |
| GUID _ WICPixelFormat32bppRGBE | GUID _ WICPixelFormat144bpp8ChannelsAlpha |
| GUID _ WICPixelFormat16bppGrayHalf | GUID _ WICPixelFormat64bppRGBAHalf |
| GUID _ WICPixelFormat32bppGrayFixedPoint | GUID _ WICPixelFormat48bppRGBHalf |
| GUID _ WICPixelFormat64bppRGBFixedPoint | GUID _ WICPixelFormat32bppRGBE |
| GUID _ WICPixelFormat128bppRGBFixedPoint | GUID _ WICPixelFormat16bppGrayHalf |
| GUID _ WICPixelFormat64bppRGBHalf | GUID _ WICPixelFormatBlackWhite |
Nativer DDS-Codec
| Decoderpixelformate | Encoder-Pixelformate |
|---|---|
| GUID _ WICPixelFormat32bppBGRA | GUID _ WICPixelFormat32bppBGRA |
| GUID _ WICPixelFormat32bppPBGRA | GUID _ WICPixelFormat32bppPBGRA |
Hinweis
Der bereitgestellte DDS Windows codec unterstützt DDS-Dateien, die mit den folgenden DXGI _ FORMAT-Werten codiert werden:
- DXGI _ FORMAT _ BC1 _ UNORM
- DXGI _ FORMAT _ BC2 _ UNORM
- _DXGI-FORMAT _ BC3 _ UNORM
Diese werden als GUID _ WICPixelFormat32bppBGRA oder GUID _ WICPixelFormat32bppPBGRA decodiert und codiert. Weitere Informationen finden Sie unter Übersicht über das DDS-Format.
Erweiterbarkeit des Pixelformats
Benutzerdefinierte Bildformate können Pixelformate verwenden, die nicht nativ von WIC bereitgestellt werden, z. B. YCbCr (YUV) und YCCK (Y/Cb/Cr/K). WIC bietet ein Erweiterbarkeitsmodell, mit dem sowohl integrierte als auch Add-In-Pixelformate innerhalb derselben Bildverarbeitungspipeline funktionieren können. Um diese Pixelformate in die WIC-Bildverarbeitungspipeline zu integrieren, müssen Sie Pixelformatkonverter erstellen, um Add-In-Pixelformate in ein oder mehrere native Pixelformate zu konvertieren. Die Hauptschnittstelle zum Erstellen von Formatkonvertern ist IWICFormatConverter.