gdk4

Enum MemoryFormat

Source
#[non_exhaustive]
pub enum MemoryFormat {
Show 33 variants B8g8r8a8Premultiplied, A8r8g8b8Premultiplied, R8g8b8a8Premultiplied, B8g8r8a8, A8r8g8b8, R8g8b8a8, A8b8g8r8, R8g8b8, B8g8r8, R16g16b16, R16g16b16a16Premultiplied, R16g16b16a16, R16g16b16Float, R16g16b16a16FloatPremultiplied, R16g16b16a16Float, R32g32b32Float, R32g32b32a32FloatPremultiplied, R32g32b32a32Float, G8a8Premultiplied, G8a8, G8, G16a16Premultiplied, G16a16, G16, A8, A16, A16Float, A32Float, A8b8g8r8Premultiplied, B8g8r8x8, X8r8g8b8, R8g8b8x8, X8b8g8r8,
}
Expand description

MemoryFormat describes formats that image data can have in memory.

It describes formats by listing the contents of the memory passed to it. So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a byte each of red, green and blue. It is not endian-dependent, so CAIRO_FORMAT_ARGB32 is represented by different GdkMemoryFormats on architectures with different endiannesses.

Its naming is modelled after VkFormat for details).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

B8g8r8a8Premultiplied

4 bytes; for blue, green, red, alpha. The color values are premultiplied with the alpha value.

§

A8r8g8b8Premultiplied

4 bytes; for alpha, red, green, blue. The color values are premultiplied with the alpha value.

§

R8g8b8a8Premultiplied

4 bytes; for red, green, blue, alpha The color values are premultiplied with the alpha value.

§

B8g8r8a8

4 bytes; for blue, green, red, alpha.

§

A8r8g8b8

4 bytes; for alpha, red, green, blue.

§

R8g8b8a8

4 bytes; for red, green, blue, alpha.

§

A8b8g8r8

4 bytes; for alpha, blue, green, red.

§

R8g8b8

3 bytes; for red, green, blue. The data is opaque.

§

B8g8r8

3 bytes; for blue, green, red. The data is opaque.

§

R16g16b16

Available on crate feature v4_6 only.

3 guint16 values; for red, green, blue.

§

R16g16b16a16Premultiplied

Available on crate feature v4_6 only.

4 guint16 values; for red, green, blue, alpha. The color values are premultiplied with the alpha value.

§

R16g16b16a16

Available on crate feature v4_6 only.

4 guint16 values; for red, green, blue, alpha.

§

R16g16b16Float

Available on crate feature v4_6 only.

3 half-float values; for red, green, blue. The data is opaque.

§

R16g16b16a16FloatPremultiplied

Available on crate feature v4_6 only.

4 half-float values; for red, green, blue and alpha. The color values are premultiplied with the alpha value.

§

R16g16b16a16Float

Available on crate feature v4_6 only.

4 half-float values; for red, green, blue and alpha.

§

R32g32b32Float

Available on crate feature v4_6 only.

3 float values; for red, green, blue.

§

R32g32b32a32FloatPremultiplied

Available on crate feature v4_6 only.

4 float values; for red, green, blue and alpha. The color values are premultiplied with the alpha value.

§

R32g32b32a32Float

Available on crate feature v4_6 only.

4 float values; for red, green, blue and alpha.

§

G8a8Premultiplied

Available on crate feature v4_12 only.

2 bytes; for grayscale, alpha. The color values are premultiplied with the alpha value.

§

G8a8

Available on crate feature v4_12 only.

2 bytes; for grayscale, alpha.

§

G8

Available on crate feature v4_12 only.

One byte; for grayscale. The data is opaque.

§

G16a16Premultiplied

Available on crate feature v4_12 only.

2 guint16 values; for grayscale, alpha. The color values are premultiplied with the alpha value.

§

G16a16

Available on crate feature v4_12 only.

2 guint16 values; for grayscale, alpha.

§

G16

Available on crate feature v4_12 only.

One guint16 value; for grayscale. The data is opaque.

§

A8

Available on crate feature v4_12 only.

One byte; for alpha.

§

A16

Available on crate feature v4_12 only.

One guint16 value; for alpha.

§

A16Float

Available on crate feature v4_12 only.

One half-float value; for alpha.

§

A32Float

Available on crate feature v4_12 only.

One float value; for alpha.

§

A8b8g8r8Premultiplied

Available on crate feature v4_14 only.

4 bytes; for alpha, blue, green, red, The color values are premultiplied with the alpha value.

§

B8g8r8x8

Available on crate feature v4_14 only.

4 bytes; for blue, green, red, unused.

§

X8r8g8b8

Available on crate feature v4_14 only.

4 bytes; for unused, red, green, blue.

§

R8g8b8x8

Available on crate feature v4_14 only.

4 bytes; for red, green, blue, unused.

§

X8b8g8r8

Available on crate feature v4_14 only.

4 bytes; for unused, blue, green, red.

Trait Implementations§

Source§

impl Clone for MemoryFormat

Source§

fn clone(&self) -> MemoryFormat

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 MemoryFormat

Source§

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

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

impl From<MemoryFormat> for Value

Source§

fn from(v: MemoryFormat) -> Self

Converts to this type from the input type.
Source§

impl<'a> FromValue<'a> for MemoryFormat

Source§

type Checker = GenericValueTypeChecker<MemoryFormat>

Value type checker.
Source§

unsafe fn from_value(value: &'a Value) -> Self

Get the contained value from a Value. Read more
Source§

impl HasParamSpec for MemoryFormat

Source§

type ParamSpec = ParamSpecEnum

Source§

type SetValue = MemoryFormat

Preferred value to be used as setter for the associated ParamSpec.
Source§

type BuilderFn = fn(_: &str, _: MemoryFormat) -> ParamSpecEnumBuilder<'_, MemoryFormat>

Source§

fn param_spec_builder() -> Self::BuilderFn

Source§

impl Hash for MemoryFormat

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for MemoryFormat

Source§

fn cmp(&self, other: &MemoryFormat) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for MemoryFormat

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for MemoryFormat

Source§

fn partial_cmp(&self, other: &MemoryFormat) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StaticType for MemoryFormat

Source§

fn static_type() -> Type

Returns the type identifier of Self.
Source§

impl ToValue for MemoryFormat

Source§

fn to_value(&self) -> Value

Convert a value to a Value.
Source§

fn value_type(&self) -> Type

Returns the type identifier of self. Read more
Source§

impl ValueType for MemoryFormat

Source§

type Type = MemoryFormat

Type to get the Type from. Read more
Source§

impl Copy for MemoryFormat

Source§

impl Eq for MemoryFormat

Source§

impl StructuralPartialEq for MemoryFormat

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> IntoClosureReturnValue for T
where T: Into<Value>,

Source§

impl<T> Property for T
where T: HasParamSpec,

Source§

type Value = T

Source§

impl<T> PropertyGet for T
where T: HasParamSpec,

Source§

type Value = T

Source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

Source§

impl<T> StaticTypeExt for T
where T: StaticType,

Source§

fn ensure_type()

Ensures that the type has been registered with the type system.
Source§

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

Source§

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> ToSendValue for T
where T: Send + ToValue + ?Sized,

Source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
Source§

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

Source§

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> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

Source§

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

Source§

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.