[][src]Struct qt_gui::q_pixel_format::TypeInterpretation

#[repr(transparent)]
pub struct 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.

C++ enum: QPixelFormat::TypeInterpretation.

C++ documentation:

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.

An unsigned integer ARGB32 pixel.

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.

Methods

impl TypeInterpretation[src]

pub fn to_int(&self) -> c_int[src]

impl TypeInterpretation[src]

pub const UnsignedInteger: TypeInterpretation[src]

C++ enum variant: UnsignedInteger = 0

pub const UnsignedShort: TypeInterpretation[src]

C++ enum variant: UnsignedShort = 1

pub const UnsignedByte: TypeInterpretation[src]

C++ enum variant: UnsignedByte = 2

pub const FloatingPoint: TypeInterpretation[src]

C++ enum variant: FloatingPoint = 3

Trait Implementations

impl Clone for TypeInterpretation[src]

impl Copy for TypeInterpretation[src]

impl Debug for TypeInterpretation[src]

impl Eq for TypeInterpretation[src]

impl From<TypeInterpretation> for c_int[src]

impl From<i32> for TypeInterpretation[src]

impl PartialEq<TypeInterpretation> for TypeInterpretation[src]

impl StructuralEq for TypeInterpretation[src]

impl StructuralPartialEq for TypeInterpretation[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.