Struct qt_gui::q_pixel_format::TypeInterpretation
source · pub struct TypeInterpretation(/* private fields */);
Expand description
This enum describes how each pixel is interpreted. If a pixel is read as a full 32 bit unsigned integer and then each channel is masked out, or if each byte is read as unsigned char values. Typically QImage formats interpret one pixel as an unsigned integer and then the color channels are masked out. OpenGL on the other hand typically interpreted pixels "one byte after the other", Ie. unsigned byte.
C++ enum: QPixelFormat::TypeInterpretation
.
This enum describes how each pixel is interpreted. If a pixel is read as a full 32 bit unsigned integer and then each channel is masked out, or if each byte is read as unsigned char values. Typically QImage formats interpret one pixel as an unsigned integer and then the color channels are masked out. OpenGL on the other hand typically interpreted pixels “one byte after the other”, Ie. unsigned byte.
QImage also have the format Format_RGBA8888 (and its derivatives), where the pixels are interpreted as unsigned bytes. OpenGL has extensions that makes it possible to upload pixel buffers in an unsigned integer format.
The image above shows a ARGB pixel in memory read as an unsigned integer. However, if this pixel was read byte for byte on a little endian system the first byte would be the byte containing the B-channel. The next byte would be the G-channel, then the R-channel and finally the A-channel. This shows that on little endian systems, how each pixel is interpreted is significant for integer formats. This is not the case on big endian systems.
Implementations§
source§impl TypeInterpretation
impl TypeInterpretation
sourcepub const UnsignedInteger: TypeInterpretation = _
pub const UnsignedInteger: TypeInterpretation = _
C++ enum variant: UnsignedInteger = 0
sourcepub const UnsignedShort: TypeInterpretation = _
pub const UnsignedShort: TypeInterpretation = _
C++ enum variant: UnsignedShort = 1
sourcepub const UnsignedByte: TypeInterpretation = _
pub const UnsignedByte: TypeInterpretation = _
C++ enum variant: UnsignedByte = 2
sourcepub const FloatingPoint: TypeInterpretation = _
pub const FloatingPoint: TypeInterpretation = _
C++ enum variant: FloatingPoint = 3
Trait Implementations§
source§impl Clone for TypeInterpretation
impl Clone for TypeInterpretation
source§fn clone(&self) -> TypeInterpretation
fn clone(&self) -> TypeInterpretation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TypeInterpretation
impl Debug for TypeInterpretation
source§impl From<TypeInterpretation> for c_int
impl From<TypeInterpretation> for c_int
source§fn from(value: TypeInterpretation) -> Self
fn from(value: TypeInterpretation) -> Self
source§impl From<i32> for TypeInterpretation
impl From<i32> for TypeInterpretation
source§impl PartialEq for TypeInterpretation
impl PartialEq for TypeInterpretation
source§fn eq(&self, other: &TypeInterpretation) -> bool
fn eq(&self, other: &TypeInterpretation) -> bool
self
and other
values to be equal, and is used
by ==
.