Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QPixelFormat Class Reference

\inmodule QtGui More...

#include <qpixelformat.h>

Collaboration diagram for QPixelFormat:

Public Types

enum  ColorModel {
  RGB , BGR , Indexed , Grayscale ,
  CMYK , HSL , HSV , YUV ,
  Alpha
}
 This enum describes the \l{colorModel()}{color model} of the pixel format. More...
enum  AlphaUsage { UsesAlpha , IgnoresAlpha }
 This enum describes the \l{alphaUsage()}{alpha usage} of the pixel format. More...
enum  AlphaPosition { AtBeginning , AtEnd }
 This enum describes the \l{alphaPosition()}{alpha position} of the pixel format. More...
enum  AlphaPremultiplied { NotPremultiplied , Premultiplied }
 This enum describes whether the alpha channel of the pixel format is \l{premultiplied}{premultiplied} into the color channels or not. More...
enum  TypeInterpretation { UnsignedInteger , UnsignedShort , UnsignedByte , FloatingPoint }
 This enum describes the \l{typeInterpretation()}{type interpretation} of the pixel format. More...
enum  YUVLayout {
  YUV444 , YUV422 , YUV411 , YUV420P ,
  YUV420SP , YV12 , UYVY , YUYV ,
  NV12 , NV21 , IMC1 , IMC2 ,
  IMC3 , IMC4 , Y8 , Y16
}
 This enum describes the \l{yuvLayout()}{YUV layout} of the pixel format, given that it has a color model of QPixelFormat::YUV. More...
enum  ByteOrder { LittleEndian , BigEndian , CurrentSystemEndian }
 This enum describes the \l{byteOrder()}{byte order} of the pixel format. More...

Public Member Functions

constexpr QPixelFormat () noexcept
 Creates a null pixelformat.
constexpr QPixelFormat (ColorModel colorModel, uchar firstSize, uchar secondSize, uchar thirdSize, uchar fourthSize, uchar fifthSize, uchar alphaSize, AlphaUsage alphaUsage, AlphaPosition alphaPosition, AlphaPremultiplied premultiplied, TypeInterpretation typeInterpretation, ByteOrder byteOrder=CurrentSystemEndian, uchar subEnum=0) noexcept
 Creates a QPixelFormat which assigns its data to the attributes.
constexpr ColorModel colorModel () const noexcept
 Accessor function for the color model.
constexpr uchar channelCount () const noexcept
 Accessor function for the channel count.
constexpr uchar redSize () const noexcept
 Accessor function for the size of the red color channel.
constexpr uchar greenSize () const noexcept
 Accessor function for the size of the green color channel.
constexpr uchar blueSize () const noexcept
 Accessor function for the size of the blue color channel.
constexpr uchar cyanSize () const noexcept
 Accessor function for the cyan color channel.
constexpr uchar magentaSize () const noexcept
 Accessor function for the megenta color channel.
constexpr uchar yellowSize () const noexcept
 Accessor function for the yellow color channel.
constexpr uchar blackSize () const noexcept
 Accessor function for the black/key color channel.
constexpr uchar hueSize () const noexcept
 Accessor function for the hue channel size.
constexpr uchar saturationSize () const noexcept
 Accessor function for the saturation channel size.
constexpr uchar lightnessSize () const noexcept
 Accessor function for the lightness channel size.
constexpr uchar brightnessSize () const noexcept
 Accessor function for the brightness channel size.
constexpr uchar alphaSize () const noexcept
 Accessor function for the alpha channel size.
constexpr uchar bitsPerPixel () const noexcept
 Accessor function for the bits used per pixel.
constexpr AlphaUsage alphaUsage () const noexcept
 Accessor function for whether the alpha channel is used or not.
constexpr AlphaPosition alphaPosition () const noexcept
 Accessor function for the position of the alpha channel relative to the color channels.
constexpr AlphaPremultiplied premultiplied () const noexcept
 Accessor function for the whether the alpha channel is multiplied in to the color channels.
constexpr TypeInterpretation typeInterpretation () const noexcept
 The type interpretation determines how each pixel should be read.
constexpr ByteOrder byteOrder () const noexcept
 The byte order of the pixel format determines the memory layout of the individual type units, as described by the typeInterpretation().
constexpr YUVLayout yuvLayout () const noexcept
 Accessor function for the YUVLayout.
constexpr uchar subEnum () const noexcept
 Accessor for the datapart which contains subEnums This is the same as the yuvLayout() function.

Friends

Q_DECL_CONST_FUNCTION constexpr bool operator== (QPixelFormat fmt1, QPixelFormat fmt2)
Q_DECL_CONST_FUNCTION constexpr bool operator!= (QPixelFormat fmt1, QPixelFormat fmt2)
Q_GUI_EXPORT QDebug operator<< (QDebug debug, const QPixelFormat &format)

(Note that these are not member symbols.)

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)
 Constructor function making an RGB pixelformat.
QPixelFormat qPixelFormatGrayscale (uchar channelSize, QPixelFormat::TypeInterpretation typeInterpretation=QPixelFormat::UnsignedInteger)
 Constructor function for creating a Grayscale format.
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)
 Constructor function for creating CMYK formats.
QPixelFormat qPixelFormatHsl (uchar channelSize, uchar alphaSize=0, QPixelFormat::AlphaUsage alphaUsage=QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition=QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation=QPixelFormat::FloatingPoint)
 Constructor function for creating HSL formats.
QPixelFormat qPixelFormatHsv (uchar channelSize, uchar alphaSize=0, QPixelFormat::AlphaUsage alphaUsage=QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition=QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation=QPixelFormat::FloatingPoint)
 Constructor function for creating HSV formats.
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)
 Constructor function for creating a QPixelFormat describing a YUV format with yuvLayout.

Detailed Description

\inmodule QtGui

Since
5.4

QPixelFormat is a class for describing different pixel layouts in graphics buffers.

In Qt there is a often a need to represent the layout of the pixels in a graphics buffer. QPixelFormat can describe up to 5 color channels and 1 alpha channel, including details about how these channels are represented in memory individually and in relation to each other.

The typeInterpretation() and byteOrder() determines how each pixel should be read/interpreted, while alphaSize(), alphaUsage(), alphaPosition(), and premultiplied() describes the position and properties of the possible alpha channel.

There is no support for describing YUV's macro pixels. Instead a list of \l{QPixelFormat::YUVLayout}{YUV formats} is provided. When a QPixelFormat describes a YUV format, the bitsPerPixel() value is deduced from the YUV layout.

Definition at line 12 of file qpixelformat.h.

Member Enumeration Documentation

◆ AlphaPosition

This enum describes the \l{alphaPosition()}{alpha position} of the pixel format.

\value AtBeginning The alpha channel will be put in front of the color channels. E.g. ARGB.

\value AtEnd The alpha channel will be put in the back of the color channels. E.g. RGBA.

See also
alphaSize(), alphaUsage(), premultiplied()
Enumerator
AtBeginning 
AtEnd 

Definition at line 90 of file qpixelformat.h.

◆ AlphaPremultiplied

This enum describes whether the alpha channel of the pixel format is \l{premultiplied}{premultiplied} into the color channels or not.

\value NotPremultiplied The alpha channel is not multiplied into the color channels.

\value Premultiplied The alpha channel is multiplied into the color channels.

See also
alphaSize(), alphaUsage(), alphaPosition()
Enumerator
NotPremultiplied 
Premultiplied 

Definition at line 96 of file qpixelformat.h.

◆ AlphaUsage

This enum describes the \l{alphaUsage()}{alpha usage} of the pixel format.

\value IgnoresAlpha The alpha channel is not used.

\value UsesAlpha The alpha channel is used.

See also
alphaSize(), alphaPosition(), premultiplied()
Enumerator
UsesAlpha 
IgnoresAlpha 

Definition at line 84 of file qpixelformat.h.

◆ ByteOrder

This enum describes the \l{byteOrder()}{byte order} of the pixel format.

\value LittleEndian The byte order is little endian. \value BigEndian The byte order is big endian. \value CurrentSystemEndian This enum will not be stored, but is converted in the constructor to the endian enum that matches the enum of the current system.

See also
typeInterpretation()
Enumerator
LittleEndian 
BigEndian 
CurrentSystemEndian 

Definition at line 130 of file qpixelformat.h.

◆ ColorModel

This enum describes the \l{colorModel()}{color model} of the pixel format.

\value RGB The color model is RGB.

\value BGR This is logically the opposite endian version of RGB. However, for ease of use it has its own model.

\value Indexed The color model uses a color palette.

\value Grayscale The color model is Grayscale.

\value CMYK The color model is CMYK.

\value HSL The color model is HSL.

\value HSV The color model is HSV.

\value YUV The color model is YUV.

\value Alpha [since 5.5] There is no color model, only alpha is used.

Enumerator
RGB 
BGR 
Indexed 
Grayscale 
CMYK 
HSL 
HSV 
YUV 
Alpha 

Definition at line 71 of file qpixelformat.h.

◆ TypeInterpretation

This enum describes the \l{typeInterpretation()}{type interpretation} of the pixel format.

\value UnsignedInteger The pixels should be read as one or more {unsigned int}. \value UnsignedShort The pixels should be read as one or more {unsigned short}. \value UnsignedByte The pixels should be read as one or more {byte}. \value FloatingPoint The pixels should be read as one or more floating point numbers, with the concrete type defined by the color/alpha channel, ie. {qfloat16} for 16-bit half-float formats and {float} for 32-bit full-float formats.

See also
byteOrder()
Enumerator
UnsignedInteger 
UnsignedShort 
UnsignedByte 
FloatingPoint 

Definition at line 102 of file qpixelformat.h.

◆ YUVLayout

This enum describes the \l{yuvLayout()}{YUV layout} of the pixel format, given that it has a color model of QPixelFormat::YUV.

\value YUV444 \value YUV422 \value YUV411 \value YUV420P \value YUV420SP \value YV12 \value UYVY \value YUYV \value NV12 \value NV21 \value IMC1 \value IMC2 \value IMC3 \value IMC4 \value Y8 \value Y16

Enumerator
YUV444 
YUV422 
YUV411 
YUV420P 
YUV420SP 
YV12 
UYVY 
YUYV 
NV12 
NV21 
IMC1 
IMC2 
IMC3 
IMC4 
Y8 
Y16 

Definition at line 110 of file qpixelformat.h.

Constructor & Destructor Documentation

◆ QPixelFormat() [1/2]

QPixelFormat::QPixelFormat ( )
inlineconstexprnoexcept

Creates a null pixelformat.

This format maps to QImage::Format_Invalid.

Definition at line 137 of file qpixelformat.h.

◆ QPixelFormat() [2/2]

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

Creates a QPixelFormat which assigns its data to the attributes.

colorModel will be put into a buffer which is 4 bits long.

firstSize secondSize thirdSize fourthSize fifthSize alphaSize are all meant to represent the size of a channel. The channels will be used for different uses dependent on the colorModel. For RGB the firstSize will represent the Red channel. On CMYK it will represent the value of the Cyan channel.

alphaUsage represents if the alpha channel is used or not.

alphaPosition is the position of the alpha channel.

premultiplied represents if the alpha channel is already multiplied with the color channels.

typeInterpretation is how the pixel is interpreted.

byteOrder represents the endianness of the pixelformat. This defaults to CurrentSystemEndian, which will be resolve to the system's endianness for non-byte-ordered formats, and QPixelFormat::BigEndian for QPixelFormat::UnsignedByte.

subEnum is used for colorModels that have to store some extra information with supplying an extra enum. This is used by YUV to store the YUV type The default value is 0.

Note
BGR formats have their own color model, and should not be described by using the opposite endianness of an RGB format.

Definition at line 224 of file qpixelformat.h.

Member Function Documentation

◆ alphaPosition()

AlphaPosition QPixelFormat::alphaPosition ( ) const
inlineconstexprnoexcept

Accessor function for the position of the alpha channel relative to the color channels.

For formats where the individual channels map to individual units, the alpha position is relative to these units. For example for QImage::Format_RGBA16FPx4 which has an alpha position of QPixelFormat::AtEnd, the alpha is the last {qfloat16} read.

For formats where multiple channels are packed into a single unit, the QPixelFormat::AtBeginning and QPixelFormat::AtEnd values map to the most significant and least significant bits of the packed unit, with respect to the format's own byteOrder().

For example, for QImage::Format_ARGB32, which has a type interpretation of QPixelFormat::UnsignedInteger and a byteOrder() that always matches the host system, the alpha position of QPixelFormat::AtBeginning means that the alpha can always be found at {0xFF000000}.

If the pixel format and host endianness does {not} match care must be taken to correctly map the pixel format layout to the host memory layout.

See also
alphaUsage(), alphaSize(), premultiplied()

Definition at line 184 of file qpixelformat.h.

◆ alphaSize()

uchar QPixelFormat::alphaSize ( ) const
inlineconstexprnoexcept

Accessor function for the alpha channel size.

Definition at line 174 of file qpixelformat.h.

◆ alphaUsage()

AlphaUsage QPixelFormat::alphaUsage ( ) const
inlineconstexprnoexcept

Accessor function for whether the alpha channel is used or not.

Sometimes the pixel format reserves place for an alpha channel, so alphaSize() will return > 0, but the alpha channel is not used/ignored.

For example, for QImage::Format_RGB32, the bitsPerPixel() is 32, because the alpha channel has a size of 8, but alphaUsage() reflects QPixelFormat::IgnoresAlpha.

Note that in such situations the \l{alphaPosition()}{position} of the unused alpha channel is still important, as it affects the placement of the color channels.

See also
alphaPosition(), alphaSize(), premultiplied()

Definition at line 183 of file qpixelformat.h.

◆ bitsPerPixel()

uchar QPixelFormat::bitsPerPixel ( ) const
inlineconstexprnoexcept

Accessor function for the bits used per pixel.

This function returns the sum of all the color channels + the size of the alpha channel.

Definition at line 176 of file qpixelformat.h.

◆ blackSize()

uchar QPixelFormat::blackSize ( ) const
inlineconstexprnoexcept

Accessor function for the black/key color channel.

Definition at line 167 of file qpixelformat.h.

◆ blueSize()

uchar QPixelFormat::blueSize ( ) const
inlineconstexprnoexcept

Accessor function for the size of the blue color channel.

Definition at line 162 of file qpixelformat.h.

◆ brightnessSize()

uchar QPixelFormat::brightnessSize ( ) const
inlineconstexprnoexcept

Accessor function for the brightness channel size.

Definition at line 172 of file qpixelformat.h.

◆ byteOrder()

ByteOrder QPixelFormat::byteOrder ( ) const
inlineconstexprnoexcept

The byte order of the pixel format determines the memory layout of the individual type units, as described by the typeInterpretation().

This function will never return QPixelFormat::CurrentSystemEndian as this value is translated to the system's endian value in the constructor.

For pixel formats with typeInterpretation() QPixelFormat::UnsignedByte this will typically be QPixelFormat::BigEndian, while other type interpretations will typically reflect the endianness of the current system.

If the byte order of the pixel format matches the current system the individual type units can be read and manipulated using the same bit masks and operations, regardless of the host system endianness. For example, with QImage::Format_ARGB32, which has a QPixelFormat::UnsignedInteger type interpretation, the alpha can always be read by masking the {unsigned int} by {0xFF000000}, regardless of the host endianness.

If the pixel format and host endianness does {not} match care must be taken to account for this. Classes like QImage do not swap the internal bits to match the host system endianness in these cases.

See also
typeInterpretation(), alphaPosition()

Definition at line 187 of file qpixelformat.h.

◆ channelCount()

uchar QPixelFormat::channelCount ( ) const
inlineconstexprnoexcept

Accessor function for the channel count.

The channel count represents channels (color and alpha) with a size > 0.

Definition at line 153 of file qpixelformat.h.

◆ colorModel()

ColorModel QPixelFormat::colorModel ( ) const
inlineconstexprnoexcept

Accessor function for the color model.

Note that for QPixelFormat::YUV the individual macro pixels can not be described. Instead a list of \l{QPixelFormat::YUVLayout}{YUV formats} is provided, and the bitsPerPixel() value is deduced from the YUV layout.

Definition at line 152 of file qpixelformat.h.

◆ cyanSize()

uchar QPixelFormat::cyanSize ( ) const
inlineconstexprnoexcept

Accessor function for the cyan color channel.

Definition at line 164 of file qpixelformat.h.

◆ greenSize()

uchar QPixelFormat::greenSize ( ) const
inlineconstexprnoexcept

Accessor function for the size of the green color channel.

Definition at line 161 of file qpixelformat.h.

◆ hueSize()

uchar QPixelFormat::hueSize ( ) const
inlineconstexprnoexcept

Accessor function for the hue channel size.

Definition at line 169 of file qpixelformat.h.

◆ lightnessSize()

uchar QPixelFormat::lightnessSize ( ) const
inlineconstexprnoexcept

Accessor function for the lightness channel size.

Definition at line 171 of file qpixelformat.h.

◆ magentaSize()

uchar QPixelFormat::magentaSize ( ) const
inlineconstexprnoexcept

Accessor function for the megenta color channel.

Definition at line 165 of file qpixelformat.h.

◆ premultiplied()

AlphaPremultiplied QPixelFormat::premultiplied ( ) const
inlineconstexprnoexcept

Accessor function for the whether the alpha channel is multiplied in to the color channels.

Definition at line 185 of file qpixelformat.h.

◆ redSize()

uchar QPixelFormat::redSize ( ) const
inlineconstexprnoexcept

Accessor function for the size of the red color channel.

Definition at line 160 of file qpixelformat.h.

◆ saturationSize()

uchar QPixelFormat::saturationSize ( ) const
inlineconstexprnoexcept

Accessor function for the saturation channel size.

Definition at line 170 of file qpixelformat.h.

◆ subEnum()

uchar QPixelFormat::subEnum ( ) const
inlineconstexprnoexcept

Accessor for the datapart which contains subEnums This is the same as the yuvLayout() function.

See also
yuvLayout()

Definition at line 190 of file qpixelformat.h.

◆ typeInterpretation()

TypeInterpretation QPixelFormat::typeInterpretation ( ) const
inlineconstexprnoexcept

The type interpretation determines how each pixel should be read.

Each pixel is represented as one or more units of the given type, laid out sequentially in memory.

Note
The \l{byteOrder()}{byte order} of the pixel format and the endianness of the host system only affect the memory layout of each individual unit being read — {not} the relative ordering of the units.

For example, QImage::Format_Mono has a \l{QImage::pixelFormat()}{pixel format} of 1 bits per pixel and a QPixelFormat::UnsignedByte type interpretation, which should be read as a single {byte}. Similarly, QImage::Format_RGB888 has a \l{QImage::pixelFormat()}{pixel format} of 24 bits per pixel, and and a QPixelFormat::UnsignedByte type interpretation, which should be read as three consecutive {byte}s.

Many of the QImage \l{QImage::Format}{formats} are 32-bit with a type interpretation of QPixelFormat::UnsignedInteger, which should be read as a single {unsigned int}.

For QPixelFormat::FloatingPoint formats like QImage::Format_RGBA16FPx4 or QImage::Format_RGBA32FPx4 the type is determined based on the size of the individual color/alpha channels, with {qfloat16} for 16-bit half-float formats and {float} for 32-bit full-float formats.

See also
byteOrder()

Definition at line 186 of file qpixelformat.h.

◆ yellowSize()

uchar QPixelFormat::yellowSize ( ) const
inlineconstexprnoexcept

Accessor function for the yellow color channel.

Definition at line 166 of file qpixelformat.h.

◆ yuvLayout()

YUVLayout QPixelFormat::yuvLayout ( ) const
inlineconstexprnoexcept

Accessor function for the YUVLayout.

It is difficult to describe the color channels of a YUV pixel format since YUV color model uses macro pixels. Instead the layout of the pixels are stored as an enum.

Definition at line 189 of file qpixelformat.h.

◆ operator!=

Q_DECL_CONST_FUNCTION constexpr bool operator!= ( QPixelFormat fmt1,
QPixelFormat fmt2 )
friend

Definition at line 203 of file qpixelformat.h.

◆ operator<<

Q_GUI_EXPORT QDebug operator<< ( QDebug debug,
const QPixelFormat & format )
friend

Definition at line 610 of file qpixelformat.cpp.

◆ operator==

Q_DECL_CONST_FUNCTION constexpr bool operator== ( QPixelFormat fmt1,
QPixelFormat fmt2 )
friend

Definition at line 200 of file qpixelformat.h.

◆ qPixelFormatAlpha()

QPixelFormat qPixelFormatAlpha ( uchar channelSize,
QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger )
related
Since
5.5

Constructor function for creating an Alpha format. A mask format can be described by passing 1 to channelSize. Its also possible to define very accurate alpha formats using doubles to describe each pixel by passing 8 as channelSize and FloatingPoint as typeInterpretation.

See also
QPixelFormat::TypeInterpretation

Definition at line 292 of file qpixelformat.h.

◆ qPixelFormatCmyk()

Constructor function for creating CMYK formats.

The channel count will be 4 or 5 depending on if alphaSize is bigger than zero or not. The CMYK color channels will all be set to the value of channelSize.

alphaUsage alphaPosition and typeInterpretation are all accessible with the accessors with the same name.

See also
QPixelFormat::TypeInterpretation

Definition at line 308 of file qpixelformat.h.

◆ qPixelFormatGrayscale()

QPixelFormat qPixelFormatGrayscale ( uchar channelSize,
QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger )
related

Constructor function for creating a Grayscale format.

Monochrome formats can be described by passing 1 to channelSize. Its also possible to define very accurate grayscale formats using doubles to describe each pixel by passing 8 as channelSize and FloatingPoint as typeInterpretation.

See also
QPixelFormat::TypeInterpretation

Definition at line 276 of file qpixelformat.h.

◆ qPixelFormatHsl()

Constructor function for creating HSL formats.

The channel count will be 3 or 4 depending on if alphaSize is bigger than 0.

channelSize will set the hueSize saturationSize and lightnessSize to the same value.

alphaUsage alphaPosition and typeInterpretation are all accessible with the accessors with the same name.

Definition at line 327 of file qpixelformat.h.

◆ qPixelFormatHsv()

Constructor function for creating HSV formats.

The channel count will be 3 or 4 depending on if alphaSize is bigger than 0.

channelSize will set the hueSize saturationSize and brightnessSize to the same value.

alphaUsage alphaPosition and typeInterpretation are all accessible with the accessors with the same name.

Definition at line 346 of file qpixelformat.h.

◆ qPixelFormatRgba()

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

Constructor function making an RGB pixelformat.

redSize greenSize blueSize represent the size of each color channel. alphaSize describes the alpha channel size and its position is described with alphaPosition. alphaUsage is used to determine if the alpha channel is used or not. Setting the alpha channel size to 8 and alphaUsage to IgnoresAlpha is how it is possible to create a 32 bit format where the rgb channels only use 24 bits combined. premultiplied typeInterpretation are accessible with accessors with the same name.

See also
QPixelFormat::TypeInterpretation

Definition at line 254 of file qpixelformat.h.

◆ qPixelFormatYuv()

Constructor function for creating a QPixelFormat describing a YUV format with yuvLayout.

alphaSize describes the size of a potential alpha channel and is position is described with alphaPosition. The "first" "second" .. "fifth" channels are all set to 0. alphaUsage premultiplied typeInterpretation and byteOrder will work as with other formats.

Definition at line 365 of file qpixelformat.h.


The documentation for this class was generated from the following files: