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
.
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
impl Format
sourcepub const FormatInvalid: Format = _
pub const FormatInvalid: Format = _
The image is invalid. (C++ enum variant: Format_Invalid = 0
)
sourcepub const FormatMono: Format = _
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
)
sourcepub const FormatMonoLSB: Format = _
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
)
sourcepub const FormatIndexed8: Format = _
pub const FormatIndexed8: Format = _
The image is stored using 8-bit indexes into a colormap. (C++ enum variant: Format_Indexed8 = 3
)
sourcepub const FormatRGB32: Format = _
pub const FormatRGB32: Format = _
The image is stored using a 32-bit RGB format (0xffRRGGBB). (C++ enum variant: Format_RGB32 = 4
)
sourcepub const FormatARGB32: Format = _
pub const FormatARGB32: Format = _
The image is stored using a 32-bit ARGB format (0xAARRGGBB). (C++ enum variant: Format_ARGB32 = 5
)
sourcepub const FormatARGB32Premultiplied: Format = _
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
)
sourcepub const FormatRGB16: Format = _
pub const FormatRGB16: Format = _
The image is stored using a 16-bit RGB format (5-6-5). (C++ enum variant: Format_RGB16 = 7
)
sourcepub const FormatARGB8565Premultiplied: Format = _
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
)
sourcepub const FormatRGB666: Format = _
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
)
sourcepub const FormatARGB6666Premultiplied: Format = _
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
)
sourcepub const FormatRGB555: Format = _
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
)
sourcepub const FormatARGB8555Premultiplied: Format = _
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
)
sourcepub const FormatRGB888: Format = _
pub const FormatRGB888: Format = _
The image is stored using a 24-bit RGB format (8-8-8). (C++ enum variant: Format_RGB888 = 13
)
sourcepub const FormatRGB444: Format = _
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
)
sourcepub const FormatARGB4444Premultiplied: Format = _
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
)
sourcepub const FormatRGBX8888: Format = _
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
)
sourcepub const FormatRGBA8888: Format = _
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
)
sourcepub const FormatRGBA8888Premultiplied: Format = _
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
)
sourcepub const FormatBGR30: Format = _
pub const FormatBGR30: Format = _
The image is stored using a 32-bit BGR format (x-10-10-10). (C++ enum variant: Format_BGR30 = 19
)
sourcepub const FormatA2BGR30Premultiplied: Format = _
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
)
sourcepub const FormatRGB30: Format = _
pub const FormatRGB30: Format = _
The image is stored using a 32-bit RGB format (x-10-10-10). (C++ enum variant: Format_RGB30 = 21
)
sourcepub const FormatA2RGB30Premultiplied: Format = _
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
)
sourcepub const FormatAlpha8: Format = _
pub const FormatAlpha8: Format = _
The image is stored using an 8-bit alpha only format. (C++ enum variant: Format_Alpha8 = 23
)
sourcepub const FormatGrayscale8: Format = _
pub const FormatGrayscale8: Format = _
The image is stored using an 8-bit grayscale format. (C++ enum variant: Format_Grayscale8 = 24
)
sourcepub const NImageFormats: Format = _
pub const NImageFormats: Format = _
C++ enum variant: NImageFormats = 25
sourcepub const FormatRGBX64: Format = _
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
)
sourcepub const FormatRGBA64: Format = _
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
)
sourcepub const FormatRGBA64Premultiplied: Format = _
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
)
sourcepub const NImageFormats2: Format = _
pub const NImageFormats2: Format = _
C++ enum variant: NImageFormats = 28
sourcepub const FormatGrayscale16: Format = _
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
)
sourcepub const NImageFormats3: Format = _
pub const NImageFormats3: Format = _
C++ enum variant: NImageFormats = 29
sourcepub const FormatBGR888: Format = _
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
)
sourcepub const NImageFormats4: Format = _
pub const NImageFormats4: Format = _
C++ enum variant: NImageFormats = 30