[][src]Struct qt_gui::q_image::Format

#[repr(transparent)]
pub struct Format(_);

The following image formats are available in Qt. Values from Format_ARGB8565_Premultiplied to Format_ARGB4444_Premultiplied were added in Qt 4.4. Values Format_RGBX8888, Format_RGBA8888 and Format_RGBA8888_Premultiplied were added in Qt 5.2. Values Format_BGR30, Format_A2BGR30_Premultiplied, Format_RGB30, Format_A2RGB30_Premultiplied were added in Qt 5.4. Format_Alpha8 and Format_Grayscale8 were added in Qt 5.5. See the notes after the table.

C++ enum: QImage::Format.

C++ documentation:

The following image formats are available in Qt. Values from Format_ARGB8565_Premultiplied to Format_ARGB4444_Premultiplied were added in Qt 4.4. Values Format_RGBX8888, Format_RGBA8888 and Format_RGBA8888_Premultiplied were added in Qt 5.2. Values Format_BGR30, Format_A2BGR30_Premultiplied, Format_RGB30, Format_A2RGB30_Premultiplied were added in Qt 5.4. Format_Alpha8 and Format_Grayscale8 were added in Qt 5.5. See the notes after the table.

Note: Drawing into a QImage with QImage::Format_Indexed8 is not supported.

Note: Do not render into ARGB32 images using QPainter. Using QImage::Format_ARGB32_Premultiplied is significantly faster.

Note: Formats with more than 8 bit per color channel will only be processed by the raster engine using 8 bit per color.

See also format() and convertToFormat().

Methods

impl Format[src]

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

impl Format[src]

pub const FormatInvalid: Format[src]

The image is invalid. (C++ enum variant: Format_Invalid = 0)

pub const FormatMono: Format[src]

The image is stored using 1-bit per pixel. Bytes are packed with the most significant bit (MSB) first. (C++ enum variant: Format_Mono = 1)

pub const FormatMonoLSB: Format[src]

The image is stored using 1-bit per pixel. Bytes are packed with the less significant bit (LSB) first. (C++ enum variant: Format_MonoLSB = 2)

pub const FormatIndexed8: Format[src]

The image is stored using 8-bit indexes into a colormap. (C++ enum variant: Format_Indexed8 = 3)

pub const FormatRGB32: Format[src]

The image is stored using a 32-bit RGB format (0xffRRGGBB). (C++ enum variant: Format_RGB32 = 4)

pub const FormatARGB32: Format[src]

The image is stored using a 32-bit ARGB format (0xAARRGGBB). (C++ enum variant: Format_ARGB32 = 5)

pub const FormatARGB32Premultiplied: Format[src]

The image is stored using a premultiplied 32-bit ARGB format (0xAARRGGBB), i.e. the red, green, and blue channels are multiplied by the alpha component divided by 255. (If RR, GG, or BB has a higher value than the alpha channel, the results are undefined.) Certain operations (such as image composition using alpha blending) are faster using premultiplied ARGB32 than with plain ARGB32. (C++ enum variant: Format_ARGB32_Premultiplied = 6)

pub const FormatRGB16: Format[src]

The image is stored using a 16-bit RGB format (5-6-5). (C++ enum variant: Format_RGB16 = 7)

pub const FormatARGB8565Premultiplied: Format[src]

The image is stored using a premultiplied 24-bit ARGB format (8-5-6-5). (C++ enum variant: Format_ARGB8565_Premultiplied = 8)

pub const FormatRGB666: Format[src]

The image is stored using a 24-bit RGB format (6-6-6). The unused most significant bits is always zero. (C++ enum variant: Format_RGB666 = 9)

pub const FormatARGB6666Premultiplied: Format[src]

The image is stored using a premultiplied 24-bit ARGB format (6-6-6-6). (C++ enum variant: Format_ARGB6666_Premultiplied = 10)

pub const FormatRGB555: Format[src]

The image is stored using a 16-bit RGB format (5-5-5). The unused most significant bit is always zero. (C++ enum variant: Format_RGB555 = 11)

pub const FormatARGB8555Premultiplied: Format[src]

The image is stored using a premultiplied 24-bit ARGB format (8-5-5-5). (C++ enum variant: Format_ARGB8555_Premultiplied = 12)

pub const FormatRGB888: Format[src]

The image is stored using a 24-bit RGB format (8-8-8). (C++ enum variant: Format_RGB888 = 13)

pub const FormatRGB444: Format[src]

The image is stored using a 16-bit RGB format (4-4-4). The unused bits are always zero. (C++ enum variant: Format_RGB444 = 14)

pub const FormatARGB4444Premultiplied: Format[src]

The image is stored using a premultiplied 16-bit ARGB format (4-4-4-4). (C++ enum variant: Format_ARGB4444_Premultiplied = 15)

pub const FormatRGBX8888: Format[src]

The image is stored using a 32-bit byte-ordered RGB(x) format (8-8-8-8). This is the same as the Format_RGBA8888 except alpha must always be 255. (C++ enum variant: Format_RGBX8888 = 16)

pub const FormatRGBA8888: Format[src]

The image is stored using a 32-bit byte-ordered RGBA format (8-8-8-8). Unlike ARGB32 this is a byte-ordered format, which means the 32bit encoding differs between big endian and little endian architectures, being respectively (0xRRGGBBAA) and (0xAABBGGRR). The order of the colors is the same on any architecture if read as bytes 0xRR,0xGG,0xBB,0xAA. (C++ enum variant: Format_RGBA8888 = 17)

pub const FormatRGBA8888Premultiplied: Format[src]

The image is stored using a premultiplied 32-bit byte-ordered RGBA format (8-8-8-8). (C++ enum variant: Format_RGBA8888_Premultiplied = 18)

pub const FormatBGR30: Format[src]

The image is stored using a 32-bit BGR format (x-10-10-10). (C++ enum variant: Format_BGR30 = 19)

pub const FormatA2BGR30Premultiplied: Format[src]

The image is stored using a 32-bit premultiplied ABGR format (2-10-10-10). (C++ enum variant: Format_A2BGR30_Premultiplied = 20)

pub const FormatRGB30: Format[src]

The image is stored using a 32-bit RGB format (x-10-10-10). (C++ enum variant: Format_RGB30 = 21)

pub const FormatA2RGB30Premultiplied: Format[src]

The image is stored using a 32-bit premultiplied ARGB format (2-10-10-10). (C++ enum variant: Format_A2RGB30_Premultiplied = 22)

pub const FormatAlpha8: Format[src]

The image is stored using an 8-bit alpha only format. (C++ enum variant: Format_Alpha8 = 23)

pub const FormatGrayscale8: Format[src]

The image is stored using an 8-bit grayscale format. (C++ enum variant: Format_Grayscale8 = 24)

pub const NImageFormats: Format[src]

C++ enum variant: NImageFormats = 25

pub const FormatRGBX64: Format[src]

The image is stored using a 64-bit halfword-ordered RGB(x) format (16-16-16-16). This is the same as the Format_RGBX64 except alpha must always be 65535. (added in Qt 5.12) (C++ enum variant: Format_RGBX64 = 25)

pub const FormatRGBA64: Format[src]

The image is stored using a 64-bit halfword-ordered RGBA format (16-16-16-16). (added in Qt 5.12) (C++ enum variant: Format_RGBA64 = 26)

pub const FormatRGBA64Premultiplied: Format[src]

The image is stored using a premultiplied 64-bit halfword-ordered RGBA format (16-16-16-16). (added in Qt 5.12) (C++ enum variant: Format_RGBA64_Premultiplied = 27)

pub const NImageFormats2: Format[src]

C++ enum variant: NImageFormats = 28

pub const FormatGrayscale16: Format[src]

The image is stored using an 16-bit grayscale format. (added in Qt 5.13) (C++ enum variant: Format_Grayscale16 = 28)

pub const NImageFormats3: Format[src]

C++ enum variant: NImageFormats = 29

Trait Implementations

impl Clone for Format[src]

impl Copy for Format[src]

impl Debug for Format[src]

impl Eq for Format[src]

impl From<Format> for c_int[src]

impl From<i32> for Format[src]

impl PartialEq<Format> for Format[src]

impl StructuralEq for Format[src]

impl StructuralPartialEq for Format[src]

Auto Trait Implementations

impl RefUnwindSafe for Format

impl Send for Format

impl Sync for Format

impl Unpin for Format

impl UnwindSafe for Format

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.