Struct qt_gui::QPixelFormat
source · #[repr(C)]pub struct QPixelFormat { /* private fields */ }
Expand description
QPixelFormat is a class for describing different pixel layouts in graphics buffers
C++ class: QPixelFormat
.
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.
Implementations§
source§impl QPixelFormat
impl QPixelFormat
sourcepub unsafe fn alpha_position(&self) -> AlphaPosition
pub unsafe fn alpha_position(&self) -> AlphaPosition
Accessor function for alphaPosition.
Calls C++ function: QPixelFormat::AlphaPosition QPixelFormat::alphaPosition() const
.
Accessor function for alphaPosition.
sourcepub unsafe fn alpha_size(&self) -> c_uchar
pub unsafe fn alpha_size(&self) -> c_uchar
Accessor function for the alpha channel size.
Calls C++ function: unsigned char QPixelFormat::alphaSize() const
.
Accessor function for the alpha channel size.
sourcepub unsafe fn alpha_usage(&self) -> AlphaUsage
pub unsafe fn alpha_usage(&self) -> AlphaUsage
Accessor function for alphaUsage.
Calls C++ function: QPixelFormat::AlphaUsage QPixelFormat::alphaUsage() const
.
Accessor function for alphaUsage.
sourcepub unsafe fn bits_per_pixel(&self) -> c_uchar
pub unsafe fn bits_per_pixel(&self) -> c_uchar
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
.
Accessor function for the bits used per pixel. This function returns the sum of the color channels + the size of the alpha channel.
sourcepub unsafe fn black_size(&self) -> c_uchar
pub unsafe fn black_size(&self) -> c_uchar
Accessor function for the black/key color channel.
Calls C++ function: unsigned char QPixelFormat::blackSize() const
.
Accessor function for the black/key color channel.
sourcepub unsafe fn blue_size(&self) -> c_uchar
pub unsafe fn blue_size(&self) -> c_uchar
Accessor function for the size of the blue color channel.
Calls C++ function: unsigned char QPixelFormat::blueSize() const
.
Accessor function for the size of the blue color channel.
sourcepub unsafe fn brightness_size(&self) -> c_uchar
pub unsafe fn brightness_size(&self) -> c_uchar
Accessor function for the brightness channel size.
Calls C++ function: unsigned char QPixelFormat::brightnessSize() const
.
Accessor function for the brightness channel size.
sourcepub unsafe fn byte_order(&self) -> ByteOrder
pub unsafe fn byte_order(&self) -> ByteOrder
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
.
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.
sourcepub unsafe fn channel_count(&self) -> c_uchar
pub unsafe fn channel_count(&self) -> c_uchar
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
.
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.
sourcepub unsafe fn color_model(&self) -> ColorModel
pub unsafe fn color_model(&self) -> ColorModel
Accessor function for getting the colorModel.
Calls C++ function: QPixelFormat::ColorModel QPixelFormat::colorModel() const
.
Accessor function for getting the colorModel.
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QPixelFormat>>
) -> Ref<QPixelFormat>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QPixelFormat>> ) -> Ref<QPixelFormat>
QPixelFormat is a class for describing different pixel layouts in graphics buffers
Calls C++ function: QPixelFormat& QPixelFormat::operator=(const QPixelFormat& other)
.
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.
sourcepub unsafe fn cyan_size(&self) -> c_uchar
pub unsafe fn cyan_size(&self) -> c_uchar
Accessor function for the cyan color channel.
Calls C++ function: unsigned char QPixelFormat::cyanSize() const
.
Accessor function for the cyan color channel.
sourcepub unsafe fn green_size(&self) -> c_uchar
pub unsafe fn green_size(&self) -> c_uchar
Accessor function for the size of the green color channel.
Calls C++ function: unsigned char QPixelFormat::greenSize() const
.
Accessor function for the size of the green color channel.
sourcepub unsafe fn hue_size(&self) -> c_uchar
pub unsafe fn hue_size(&self) -> c_uchar
Accessor function for the hue channel size.
Calls C++ function: unsigned char QPixelFormat::hueSize() const
.
Accessor function for the hue channel size.
sourcepub unsafe fn lightness_size(&self) -> c_uchar
pub unsafe fn lightness_size(&self) -> c_uchar
Accessor function for the lightness channel size.
Calls C++ function: unsigned char QPixelFormat::lightnessSize() const
.
Accessor function for the lightness channel size.
sourcepub unsafe fn magenta_size(&self) -> c_uchar
pub unsafe fn magenta_size(&self) -> c_uchar
Accessor function for the megenta color channel.
Calls C++ function: unsigned char QPixelFormat::magentaSize() const
.
Accessor function for the megenta color channel.
sourcepub unsafe fn new_0a() -> CppBox<QPixelFormat>
pub unsafe fn new_0a() -> CppBox<QPixelFormat>
Creates a null pixelformat. This format maps to QImage::Format_Invalid.
Calls C++ function: [constructor] void QPixelFormat::QPixelFormat()
.
Creates a null pixelformat. This format maps to QImage::Format_Invalid.
sourcepub 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>
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>
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 = …)
.
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.
sourcepub 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>
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>
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 = …)
.
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.
sourcepub 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>
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>
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)
.
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.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QPixelFormat>>
) -> CppBox<QPixelFormat>
pub unsafe fn new_copy( other: impl CastInto<Ref<QPixelFormat>> ) -> CppBox<QPixelFormat>
QPixelFormat is a class for describing different pixel layouts in graphics buffers
Calls C++ function: [constructor] void QPixelFormat::QPixelFormat(const QPixelFormat& other)
.
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.
sourcepub unsafe fn premultiplied(&self) -> AlphaPremultiplied
pub unsafe fn premultiplied(&self) -> AlphaPremultiplied
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
.
Accessor function for the AlphaPremultiplied enum. This indicates if the alpha channel is multiplied in to the color channels.
sourcepub unsafe fn red_size(&self) -> c_uchar
pub unsafe fn red_size(&self) -> c_uchar
Accessor function for the size of the red color channel.
Calls C++ function: unsigned char QPixelFormat::redSize() const
.
Accessor function for the size of the red color channel.
sourcepub unsafe fn saturation_size(&self) -> c_uchar
pub unsafe fn saturation_size(&self) -> c_uchar
Accessor function for the saturation channel size.
Calls C++ function: unsigned char QPixelFormat::saturationSize() const
.
Accessor function for the saturation channel size.
sourcepub unsafe fn sub_enum(&self) -> c_uchar
pub unsafe fn sub_enum(&self) -> c_uchar
Calls C++ function: unsigned char QPixelFormat::subEnum() const
.
sourcepub unsafe fn type_interpretation(&self) -> TypeInterpretation
pub unsafe fn type_interpretation(&self) -> TypeInterpretation
Accessor function for the type representation of a color channel or a pixel.
Calls C++ function: QPixelFormat::TypeInterpretation QPixelFormat::typeInterpretation() const
.
Accessor function for the type representation of a color channel or a pixel.
See also TypeInterpretation.
sourcepub unsafe fn yellow_size(&self) -> c_uchar
pub unsafe fn yellow_size(&self) -> c_uchar
Accessor function for the yellow color channel.
Calls C++ function: unsigned char QPixelFormat::yellowSize() const
.
Accessor function for the yellow color channel.
sourcepub unsafe fn yuv_layout(&self) -> YUVLayout
pub unsafe fn yuv_layout(&self) -> YUVLayout
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
.
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§
source§impl CppDeletable for QPixelFormat
impl CppDeletable for QPixelFormat
source§unsafe fn delete(&self)
unsafe fn delete(&self)
QPixelFormat is a class for describing different pixel layouts in graphics buffers
Calls C++ function: [destructor] void QPixelFormat::~QPixelFormat()
.
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.