# [−][src]Struct image::LumaA

    #[repr(C)]
    pub struct LumaA<T: Primitive> {
        pub data: [T; 2],
    }

Grayscale colors + alpha channel

## Fields

`data: [T; 2]`

## Trait Implementations

### `impl<T: Primitive + 'static> Pixel for LumaA<T>`[src]

#### `type Subpixel = T`

The underlying subpixel type.

#### `fn channel_count() -> u8`[src]

Returns the number of channels of this pixel type.

#### `fn color_model() -> &'static str`[src]

Returns a string that can help to interpret the meaning each channel See gimp babl. Read more

#### `fn color_type() -> ColorType`[src]

Returns the ColorType for this pixel format

#### `fn channels(&self) -> &[T]`[src]

Returns the components as a slice.

#### `fn channels_mut(&mut self) -> &mut [T]`[src]

Returns the components as a mutable slice

#### `fn channels4(&self) -> (T, T, T, T)`[src]

Returns the channels of this pixel as a 4 tuple. If the pixel has less than 4 channels the remainder is filled with the maximum value Read more

#### `fn from_channels(a: T, b: T, c: T, d: T) -> LumaA<T>`[src]

Construct a pixel from the 4 channels a, b, c and d. If the pixel does not contain 4 channels the extra are ignored. Read more

#### `fn from_slice(slice: &[T]) -> &LumaA<T>`[src]

Returns a view into a slice. Read more

#### `fn from_slice_mut(slice: &mut [T]) -> &mut LumaA<T>`[src]

Returns mutable view into a mutable slice. Read more

#### `fn to_rgb(&self) -> Rgb<T>`[src]

Convert this pixel to RGB

#### `fn to_bgr(&self) -> Bgr<T>`[src]

Convert this pixel to BGR

#### `fn to_rgba(&self) -> Rgba<T>`[src]

Convert this pixel to RGB with an alpha channel

#### `fn to_bgra(&self) -> Bgra<T>`[src]

Convert this pixel to BGR with an alpha channel

#### `fn to_luma(&self) -> Luma<T>`[src]

Convert this pixel to luma

#### `fn to_luma_alpha(&self) -> LumaA<T>`[src]

Convert this pixel to luma with an alpha channel

#### `fn map<F>(&self, f: F) -> LumaA<T> where
F: FnMut(T) -> T,` [src]

Apply the function `f` to each channel of this pixel.

#### `fn apply<F>(&mut self, f: F) where
F: FnMut(T) -> T,` [src]

Apply the function `f` to each channel of this pixel.

#### `fn map_with_alpha<F, G>(&self, f: F, g: G) -> LumaA<T> where
F: FnMut(T) -> T,
G: FnMut(T) -> T,` [src]

Apply the function `f` to each channel except the alpha channel. Apply the function `g` to the alpha channel. Read more

#### `fn apply_with_alpha<F, G>(&mut self, f: F, g: G) where
F: FnMut(T) -> T,
G: FnMut(T) -> T,` [src]

Apply the function `f` to each channel except the alpha channel. Apply the function `g` to the alpha channel. Works in-place. Read more

#### `fn map2<F>(&self, other: &Self, f: F) -> LumaA<T> where
F: FnMut(T, T) -> T,` [src]

Apply the function `f` to each channel of this pixel and `other` pairwise. Read more

#### `fn apply2<F>(&mut self, other: &LumaA<T>, f: F) where
F: FnMut(T, T) -> T,` [src]

Apply the function `f` to each channel of this pixel and `other` pairwise. Works in-place. Read more

#### `fn invert(&mut self)`[src]

Invert this pixel

#### `fn blend(&mut self, other: &LumaA<T>)`[src]

Blend the color of a given pixel into ourself, taking into account alpha channels

### `impl<T: Eq + Primitive> Eq for LumaA<T>`[src]

### `impl<T: Clone + Primitive> Clone for LumaA<T>`[src]

#### `fn clone(&self) -> LumaA<T>`[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`1.0.0[src]

Performs copy-assignment from `source`. Read more

### `impl<T: PartialEq + Primitive> PartialEq<LumaA<T>> for LumaA<T>`[src]

#### `fn eq(&self, other: &LumaA<T>) -> bool`[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &LumaA<T>) -> bool`[src]

This method tests for `!=`.

### `impl<T: Copy + Primitive> Copy for LumaA<T>`[src]

### `impl<T: Hash + Primitive> Hash for LumaA<T>`[src]

#### `fn hash<__H: Hasher>(&self, state: &mut __H)`[src]

Feeds this value into the given [`Hasher`]. Read more

#### `fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,` 1.3.0[src]

Feeds a slice of this type into the given [`Hasher`]. Read more

### `impl<T: Primitive> Index<usize> for LumaA<T>`[src]

#### `type Output = T`

The returned type after indexing.

#### `fn index(&self, _index: usize) -> &T`[src]

Performs the indexing (`container[index]`) operation.

### `impl<T: Primitive> IndexMut<usize> for LumaA<T>`[src]

#### `fn index_mut(&mut self, _index: usize) -> &mut T`[src]

Performs the mutable indexing (`container[index]`) operation.

### `impl<T: Debug + Primitive> Debug for LumaA<T>`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`[src]

Formats the value using the given formatter. Read more

## Auto Trait Implementations

### `impl<T> Send for LumaA<T> where
T: Send,`

### `impl<T> Unpin for LumaA<T> where
T: Unpin,`

### `impl<T> Sync for LumaA<T> where
T: Sync,`

### `impl<T> UnwindSafe for LumaA<T> where
T: UnwindSafe,`

### `impl<T> RefUnwindSafe for LumaA<T> where
T: RefUnwindSafe,`

## Blanket Implementations

### `impl<T> ToOwned for T where
T: Clone,` [src]

#### `type Owned = T`

The resulting type after obtaining ownership.

#### `fn to_owned(&self) -> T`[src]

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

#### `fn clone_into(&self, target: &mut T)`[src]

🔬 This is a nightly-only experimental API. (`toowned_clone_into`)

recently added

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

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `fn into(self) -> U`[src]

Performs the conversion.

### `impl<T> From<T> for T`[src]

#### `fn from(t: T) -> T`[src]

Performs the conversion.

### `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.

#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

### `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.

#### `fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`[src]

Performs the conversion.

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

#### `fn borrow_mut(&mut self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

#### `fn borrow(&self) -> &T`[src]

Immutably borrows from an owned value. Read more

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `fn type_id(&self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

### `impl<T> SetParameter for T`[src]

#### `fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,` [src]

Sets `value` as a parameter of `self`.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)