pub struct ImageConversionFlag(/* private fields */);
Expand description

The options marked "(default)" are set if no other values from the list are included (since the defaults are zero):

C++ enum: Qt::ImageConversionFlag.

C++ documentation:

The options marked “(default)” are set if no other values from the list are included (since the defaults are zero):

Color/Mono preference (ignored for QBitmap):

Dithering mode preference:

Dithering mode preference for 1-bit alpha masks:

Color matching versus dithering preference:

The ImageConversionFlags type is a typedef for QFlags<ImageConversionFlag>. It stores an OR combination of ImageConversionFlag values.

Implementations§

source§

impl ImageConversionFlag

source

pub fn to_int(&self) -> c_int

source§

impl ImageConversionFlag

source

pub const ColorModeMask: ImageConversionFlag = _

C++ enum variant: ColorMode_Mask = 3

source

pub const AutoColor: ImageConversionFlag = _

(default) - If the image has depth 1 and contains only black and white pixels, the pixmap becomes monochrome. (C++ enum variant: AutoColor = 0)

source

pub const ColorOnly: ImageConversionFlag = _

The pixmap is dithered/converted to the native display depth. (C++ enum variant: ColorOnly = 3)

source

pub const MonoOnly: ImageConversionFlag = _

The pixmap becomes monochrome. If necessary, it is dithered using the chosen dithering algorithm. (C++ enum variant: MonoOnly = 2)

source

pub const AlphaDitherMask: ImageConversionFlag = _

C++ enum variant: AlphaDither_Mask = 12

source

pub const ThresholdAlphaDither: ImageConversionFlag = _

(default) - No dithering. (C++ enum variant: ThresholdAlphaDither = 0)

source

pub const OrderedAlphaDither: ImageConversionFlag = _

A faster, ordered dither. (C++ enum variant: OrderedAlphaDither = 4)

source

pub const DiffuseAlphaDither: ImageConversionFlag = _

A high-quality dither using error diffusion. (C++ enum variant: DiffuseAlphaDither = 8)

source

pub const NoAlpha: ImageConversionFlag = _

C++ enum variant: NoAlpha = 12

source

pub const DitherMask: ImageConversionFlag = _

C++ enum variant: Dither_Mask = 48

source

pub const DiffuseDither: ImageConversionFlag = _

(default) - A high-quality dither using error diffusion. (C++ enum variant: DiffuseDither = 0)

source

pub const OrderedDither: ImageConversionFlag = _

A faster, ordered dither. (C++ enum variant: OrderedDither = 16)

source

pub const ThresholdDither: ImageConversionFlag = _

No dithering; closest color is used. (C++ enum variant: ThresholdDither = 32)

source

pub const DitherModeMask: ImageConversionFlag = _

C++ enum variant: DitherMode_Mask = 192

source

pub const AutoDither: ImageConversionFlag = _

(default) - Only dither when down-converting to 1 or 8-bit indexed formats. (C++ enum variant: AutoDither = 0)

source

pub const PreferDither: ImageConversionFlag = _

Always dither images when converting to smaller color-spaces. (C++ enum variant: PreferDither = 64)

source

pub const AvoidDither: ImageConversionFlag = _

Only dither to indexed formats if the source image uses more different colors than the size of the color table of the destination format. (C++ enum variant: AvoidDither = 128)

source

pub const NoOpaqueDetection: ImageConversionFlag = _

Do not check whether the image contains non-opaque pixels. Use this if you know that the image is semi-transparent and you want to avoid the overhead of checking the pixels in the image until a non-opaque pixel is found, or if you want the pixmap to retain an alpha channel for some other reason. If the image has no alpha channel this flag has no effect. (C++ enum variant: NoOpaqueDetection = 256)

source

pub const NoFormatConversion: ImageConversionFlag = _

Don’t do any format conversions on the image. Can be useful when converting a QImage to a QPixmap for a one-time rendering operation for example. Note that a QPixmap not in the preferred format will be much slower as a paint device. (C++ enum variant: NoFormatConversion = 512)

Trait Implementations§

source§

impl<T: Into<QFlags<ImageConversionFlag>>> BitOr<T> for ImageConversionFlag

§

type Output = QFlags<ImageConversionFlag>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: T) -> QFlags<ImageConversionFlag>

Performs the | operation. Read more
source§

impl Clone for ImageConversionFlag

source§

fn clone(&self) -> ImageConversionFlag

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 ImageConversionFlag

source§

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

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

impl From<ImageConversionFlag> for QFlags<ImageConversionFlag>

source§

fn from(value: ImageConversionFlag) -> Self

Converts to this type from the input type.
source§

impl From<ImageConversionFlag> for c_int

source§

fn from(value: ImageConversionFlag) -> Self

Converts to this type from the input type.
source§

impl From<i32> for ImageConversionFlag

source§

fn from(value: c_int) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ImageConversionFlag

source§

fn eq(&self, other: &ImageConversionFlag) -> 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 ImageConversionFlag

source§

impl Eq for ImageConversionFlag

source§

impl StructuralEq for ImageConversionFlag

source§

impl StructuralPartialEq for ImageConversionFlag

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.