[][src]Struct qt_gui::QPixelFormat

#[repr(C)]pub struct QPixelFormat { /* fields omitted */ }

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

C++ class: QPixelFormat.

C++ documentation:

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. 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.

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.

Methods

impl QPixelFormat[src]

pub unsafe fn alpha_position(&self) -> AlphaPosition[src]

Accessor function for alphaPosition.

Calls C++ function: QPixelFormat::AlphaPosition QPixelFormat::alphaPosition() const.

C++ documentation:

Accessor function for alphaPosition.

pub unsafe fn alpha_size(&self) -> c_uchar[src]

Accessor function for the alpha channel size.

Calls C++ function: unsigned char QPixelFormat::alphaSize() const.

C++ documentation:

Accessor function for the alpha channel size.

pub unsafe fn alpha_usage(&self) -> AlphaUsage[src]

Accessor function for alphaUsage.

Calls C++ function: QPixelFormat::AlphaUsage QPixelFormat::alphaUsage() const.

C++ documentation:

Accessor function for alphaUsage.

pub unsafe fn bits_per_pixel(&self) -> c_uchar[src]

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

Calls C++ function: unsigned char QPixelFormat::bitsPerPixel() const.

C++ documentation:

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

pub unsafe fn black_size(&self) -> c_uchar[src]

Accessor function for the black/key color channel.

Calls C++ function: unsigned char QPixelFormat::blackSize() const.

C++ documentation:

Accessor function for the black/key color channel.

pub unsafe fn blue_size(&self) -> c_uchar[src]

Accessor function for the size of the blue color channel.

Calls C++ function: unsigned char QPixelFormat::blueSize() const.

C++ documentation:

Accessor function for the size of the blue color channel.

pub unsafe fn brightness_size(&self) -> c_uchar[src]

Accessor function for the brightness channel size.

Calls C++ function: unsigned char QPixelFormat::brightnessSize() const.

C++ documentation:

Accessor function for the brightness channel size.

pub unsafe fn byte_order(&self) -> ByteOrder[src]

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.

Calls C++ function: QPixelFormat::ByteOrder QPixelFormat::byteOrder() const.

C++ documentation:

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.

pub unsafe fn channel_count(&self) -> c_uchar[src]

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.

Calls C++ function: unsigned char QPixelFormat::channelCount() const.

C++ documentation:

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.

pub unsafe fn color_model(&self) -> ColorModel[src]

Accessor function for getting the colorModel.

Calls C++ function: QPixelFormat::ColorModel QPixelFormat::colorModel() const.

C++ documentation:

Accessor function for getting the colorModel.

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QPixelFormat>>
) -> Ref<QPixelFormat>
[src]

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

Calls C++ function: QPixelFormat& QPixelFormat::operator=(const QPixelFormat& other).

C++ documentation:

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. 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.

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.

pub unsafe fn cyan_size(&self) -> c_uchar[src]

Accessor function for the cyan color channel.

Calls C++ function: unsigned char QPixelFormat::cyanSize() const.

C++ documentation:

Accessor function for the cyan color channel.

pub unsafe fn green_size(&self) -> c_uchar[src]

Accessor function for the size of the green color channel.

Calls C++ function: unsigned char QPixelFormat::greenSize() const.

C++ documentation:

Accessor function for the size of the green color channel.

pub unsafe fn hue_size(&self) -> c_uchar[src]

Accessor function for the hue channel size.

Calls C++ function: unsigned char QPixelFormat::hueSize() const.

C++ documentation:

Accessor function for the hue channel size.

pub unsafe fn lightness_size(&self) -> c_uchar[src]

Accessor function for the lightness channel size.

Calls C++ function: unsigned char QPixelFormat::lightnessSize() const.

C++ documentation:

Accessor function for the lightness channel size.

pub unsafe fn magenta_size(&self) -> c_uchar[src]

Accessor function for the megenta color channel.

Calls C++ function: unsigned char QPixelFormat::magentaSize() const.

C++ documentation:

Accessor function for the megenta color channel.

pub unsafe fn new_0a() -> CppBox<QPixelFormat>[src]

Creates a null pixelformat. This format maps to QImage::Format_Invalid.

Calls C++ function: [constructor] void QPixelFormat::QPixelFormat().

C++ documentation:

Creates a null pixelformat. This format maps to QImage::Format_Invalid.

pub unsafe fn new_13a(
    color_model: ColorModel,
    first_size: c_uchar,
    second_size: c_uchar,
    third_size: c_uchar,
    fourth_size: c_uchar,
    fifth_size: c_uchar,
    alpha_size: c_uchar,
    alpha_usage: AlphaUsage,
    alpha_position: AlphaPosition,
    premultiplied: AlphaPremultiplied,
    type_interpretation: TypeInterpretation,
    byte_order: ByteOrder,
    sub_enum: c_uchar
) -> CppBox<QPixelFormat>
[src]

Creates a QPixelFormat which assigns its data to the attributes. colorModel will be put into a buffer which is 4 bits long.

Calls C++ function: [constructor] void QPixelFormat::QPixelFormat(QPixelFormat::ColorModel colorModel, unsigned char firstSize, unsigned char secondSize, unsigned char thirdSize, unsigned char fourthSize, unsigned char fifthSize, unsigned char alphaSize, QPixelFormat::AlphaUsage alphaUsage, QPixelFormat::AlphaPosition alphaPosition, QPixelFormat::AlphaPremultiplied premultiplied, QPixelFormat::TypeInterpretation typeInterpretation, QPixelFormat::ByteOrder byteOrder = …, unsigned char subEnum = …).

C++ documentation:

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.

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.

pub unsafe fn new_12a(
    color_model: ColorModel,
    first_size: c_uchar,
    second_size: c_uchar,
    third_size: c_uchar,
    fourth_size: c_uchar,
    fifth_size: c_uchar,
    alpha_size: c_uchar,
    alpha_usage: AlphaUsage,
    alpha_position: AlphaPosition,
    premultiplied: AlphaPremultiplied,
    type_interpretation: TypeInterpretation,
    byte_order: ByteOrder
) -> CppBox<QPixelFormat>
[src]

Creates a QPixelFormat which assigns its data to the attributes. colorModel will be put into a buffer which is 4 bits long.

Calls C++ function: [constructor] void QPixelFormat::QPixelFormat(QPixelFormat::ColorModel colorModel, unsigned char firstSize, unsigned char secondSize, unsigned char thirdSize, unsigned char fourthSize, unsigned char fifthSize, unsigned char alphaSize, QPixelFormat::AlphaUsage alphaUsage, QPixelFormat::AlphaPosition alphaPosition, QPixelFormat::AlphaPremultiplied premultiplied, QPixelFormat::TypeInterpretation typeInterpretation, QPixelFormat::ByteOrder byteOrder = …).

C++ documentation:

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.

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.

pub unsafe fn new_11a(
    color_model: ColorModel,
    first_size: c_uchar,
    second_size: c_uchar,
    third_size: c_uchar,
    fourth_size: c_uchar,
    fifth_size: c_uchar,
    alpha_size: c_uchar,
    alpha_usage: AlphaUsage,
    alpha_position: AlphaPosition,
    premultiplied: AlphaPremultiplied,
    type_interpretation: TypeInterpretation
) -> CppBox<QPixelFormat>
[src]

Creates a QPixelFormat which assigns its data to the attributes. colorModel will be put into a buffer which is 4 bits long.

Calls C++ function: [constructor] void QPixelFormat::QPixelFormat(QPixelFormat::ColorModel colorModel, unsigned char firstSize, unsigned char secondSize, unsigned char thirdSize, unsigned char fourthSize, unsigned char fifthSize, unsigned char alphaSize, QPixelFormat::AlphaUsage alphaUsage, QPixelFormat::AlphaPosition alphaPosition, QPixelFormat::AlphaPremultiplied premultiplied, QPixelFormat::TypeInterpretation typeInterpretation).

C++ documentation:

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.

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.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QPixelFormat>>
) -> CppBox<QPixelFormat>
[src]

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

Calls C++ function: [constructor] void QPixelFormat::QPixelFormat(const QPixelFormat& other).

C++ documentation:

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. 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.

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.

pub unsafe fn premultiplied(&self) -> AlphaPremultiplied[src]

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

Calls C++ function: QPixelFormat::AlphaPremultiplied QPixelFormat::premultiplied() const.

C++ documentation:

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

pub unsafe fn red_size(&self) -> c_uchar[src]

Accessor function for the size of the red color channel.

Calls C++ function: unsigned char QPixelFormat::redSize() const.

C++ documentation:

Accessor function for the size of the red color channel.

pub unsafe fn saturation_size(&self) -> c_uchar[src]

Accessor function for the saturation channel size.

Calls C++ function: unsigned char QPixelFormat::saturationSize() const.

C++ documentation:

Accessor function for the saturation channel size.

pub unsafe fn sub_enum(&self) -> c_uchar[src]

Calls C++ function: unsigned char QPixelFormat::subEnum() const.

pub unsafe fn type_interpretation(&self) -> TypeInterpretation[src]

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

Calls C++ function: QPixelFormat::TypeInterpretation QPixelFormat::typeInterpretation() const.

C++ documentation:

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

See also TypeInterpretation.

pub unsafe fn yellow_size(&self) -> c_uchar[src]

Accessor function for the yellow color channel.

Calls C++ function: unsigned char QPixelFormat::yellowSize() const.

C++ documentation:

Accessor function for the yellow color channel.

pub unsafe fn yuv_layout(&self) -> YUVLayout[src]

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.

Calls C++ function: QPixelFormat::YUVLayout QPixelFormat::yuvLayout() const.

C++ documentation:

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

impl CppDeletable for QPixelFormat[src]

unsafe fn delete(&self)[src]

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

Calls C++ function: [destructor] void QPixelFormat::~QPixelFormat().

C++ documentation:

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. 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.

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.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.