pub struct PixelFormat<'a> { /* private fields */ }
Expand description

Notice these docs are heavy WIP and not very relevent yet

In Qt there is a often a need to represent the layout of the pixels in a graphics buffer. Internally QPixelFormat stores everything in a 64 bit datastructure. This gives performance but also some limitations.

QPixelFormat can describe 5 color channels and 1 alpha channel, each can use 6 bits to describe the size of the color channel.

The position of the alpha channel is described with a separate enum. This is to make it possible to describe QImage formats like ARGB32, and also describe typical OpenGL formats like RBGA8888.

How pixels are suppose to be read is determined by the TypeInterpretation enum. It describes if color values are suppose to be read byte per byte, or if a pixel is suppose to be read as a complete int and then masked. See also: TypeInterpretation

There is no support for describing YUV’s macro pixels. Instead a list of YUV formats has been made. When a QPixelFormat is describing a YUV format, the bitsPerPixel value has been deduced by the YUV Layout enum. Also, the color channels should all be set to zero except the fifth color channel that should store the bitsPerPixel value.

Licence

The documentation is an adoption of the original Qt Documentation and provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.

Implementations

Accessor function for getting the colorModel.

Accessor function for getting the channelCount. Channel Count is deduced by color channels with a size > 0 and if the size of the alpha channel is > 0.

Accessor function for the size of the red color channel.

Accessor function for the size of the green color channel.

Accessor function for the size of the blue color channel.

Accessor function for the cyan color channel.

Accessor function for the megenta color channel.

Accessor function for the yellow color channel.

Accessor function for the black/key color channel.

Accessor function for the hue channel size.

Accessor function for the saturation channel size.

Accessor function for the lightness channel size.

Accessor function for the brightness channel size.

Accessor function for the alpha channel size.

Accessor function for the bits used per pixel. This function returns the sum of the color channels + the size of the alpha channel.

Accessor function for alphaUsage.

Accessor function for alphaPosition.

Accessor function for the AlphaPremultiplied enum. This indicates if the alpha channel is multiplied in to the color channels.

Accessor function for the type representation of a color channel or a pixel.

See also: TypeInterpretation

The byte order is almost always set the the byte order of the current system. However, it can be useful to describe some YUV formats. This function should never return QPixelFormat::CurrentSystemEndian as this value is translated to a endian value in the constructor.

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.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.