[−][src]Struct qt_gui::q_pixel_format::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
.
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.
Methods
impl TypeInterpretation
[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]
fn clone(&self) -> TypeInterpretation
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for TypeInterpretation
[src]
impl Debug for TypeInterpretation
[src]
impl Eq for TypeInterpretation
[src]
impl From<TypeInterpretation> for c_int
[src]
fn from(value: TypeInterpretation) -> Self
[src]
impl From<i32> for TypeInterpretation
[src]
impl PartialEq<TypeInterpretation> for TypeInterpretation
[src]
fn eq(&self, other: &TypeInterpretation) -> bool
[src]
fn ne(&self, other: &TypeInterpretation) -> bool
[src]
impl StructuralEq for TypeInterpretation
[src]
impl StructuralPartialEq for TypeInterpretation
[src]
Auto Trait Implementations
impl RefUnwindSafe for TypeInterpretation
impl Send for TypeInterpretation
impl Sync for TypeInterpretation
impl Unpin for TypeInterpretation
impl UnwindSafe for TypeInterpretation
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,