Struct qt_gui::q_image::Format

source ·
pub struct Format(/* private fields */);
Expand description

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().

Implementations§

source§

impl Format

source

pub fn to_int(&self) -> c_int

source§

impl Format

source

pub const FormatInvalid: Format = _

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

source

pub const FormatMono: Format = _

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)

source

pub const FormatMonoLSB: Format = _

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)

source

pub const FormatIndexed8: Format = _

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

source

pub const FormatRGB32: Format = _

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

source

pub const FormatARGB32: Format = _

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

source

pub const FormatARGB32Premultiplied: Format = _

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)

source

pub const FormatRGB16: Format = _

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

source

pub const FormatARGB8565Premultiplied: Format = _

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

source

pub const FormatRGB666: Format = _

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)

source

pub const FormatARGB6666Premultiplied: Format = _

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

source

pub const FormatRGB555: Format = _

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)

source

pub const FormatARGB8555Premultiplied: Format = _

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

source

pub const FormatRGB888: Format = _

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

source

pub const FormatRGB444: Format = _

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)

source

pub const FormatARGB4444Premultiplied: Format = _

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

source

pub const FormatRGBX8888: Format = _

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)

source

pub const FormatRGBA8888: Format = _

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)

source

pub const FormatRGBA8888Premultiplied: Format = _

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

source

pub const FormatBGR30: Format = _

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

source

pub const FormatA2BGR30Premultiplied: Format = _

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

source

pub const FormatRGB30: Format = _

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

source

pub const FormatA2RGB30Premultiplied: Format = _

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

source

pub const FormatAlpha8: Format = _

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

source

pub const FormatGrayscale8: Format = _

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

source

pub const NImageFormats: Format = _

C++ enum variant: NImageFormats = 25

source

pub const FormatRGBX64: Format = _

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)

source

pub const FormatRGBA64: Format = _

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)

source

pub const FormatRGBA64Premultiplied: Format = _

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)

source

pub const NImageFormats2: Format = _

C++ enum variant: NImageFormats = 28

source

pub const FormatGrayscale16: Format = _

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

source

pub const NImageFormats3: Format = _

C++ enum variant: NImageFormats = 29

source

pub const FormatBGR888: Format = _

The image is stored using a 24-bit BGR format. (added in Qt 5.14) (C++ enum variant: Format_BGR888 = 29)

source

pub const NImageFormats4: Format = _

C++ enum variant: NImageFormats = 30

Trait Implementations§

source§

impl Clone for Format

source§

fn clone(&self) -> Format

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Format

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Format> for c_int

source§

fn from(value: Format) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Format

source§

fn from(value: c_int) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Format

source§

fn eq(&self, other: &Format) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Format

source§

impl Eq for Format

source§

impl StructuralEq for Format

source§

impl StructuralPartialEq for Format

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.