pub struct RGBA {
pub r: f64,
pub g: f64,
pub b: f64,
pub a: f64,
}Expand description
§Red Green Blue Alpha container
§Description
RGBA data in 0->1 range floats
These values remove gamma-corrected values so that you can apply maths on them
This means the RGBA values are in linear space
§Usage
Methods that are available:
RGBA::default: returns a new RGBA value with RGB set to 0.0 and alpha set to 1.0RGBA::new: returns a new RGBA valueRGBA::from_gamma: Create a new RGBA value from gamma-corrected valuesRGBA::to_gamma: Convert RGBA to gamma-corrected valuesRGBA::from_reader: returns a new RGBA value from a readerRGBA::from_u8s: returns a new RGBA value from 4 u8 valuesRGBA::to_u8s: returns a new RGBA value from 4 u8 valuesRGBA::from_u16s: returns a new RGBA value from 4 u16 valuesRGBA::to_u16s: returns a new RGBA value from 4 u16 valuesRGBA::from_u32: returns a new RGBA value from 4 u32 valuesRGBA::to_u32s: returns a new RGBA value from 4 u32 valuesRGBA::from_u64: returns a new RGBA value from 4 u64 valuesRGBA::to_u64s: returns a new RGBA value from 4 u64 valuesRGBA::from_hex: Create an RGBA color from a hex string
Fields§
§r: f64Gamma corrected Red between 0 and 1
g: f64Gamma corrected Green between 0 and 1
b: f64Gamma corrected Blue between 0 and 1
a: f64Opacity between 0 and 1 (not gamma corrected as opacity is linear)
Implementations§
Source§impl RGBA
impl RGBA
Sourcepub fn from_gamma(r: f64, g: f64, b: f64, a: f64) -> Self
pub fn from_gamma(r: f64, g: f64, b: f64, a: f64) -> Self
Create a new RGBA value from gamma-corrected values
Sourcepub fn to_u8s(self) -> (u8, u8, u8, u8)
pub fn to_u8s(self) -> (u8, u8, u8, u8)
Convert RGBA to 4 u8 values in Gamma corrected 0->255 range
Sourcepub fn from_reader<R: Reader>(reader: &R, offset: Option<u64>) -> Self
pub fn from_reader<R: Reader>(reader: &R, offset: Option<u64>) -> Self
Create a new RGBA value from 4 u16 values
Sourcepub fn from_u16s(r: u16, g: u16, b: u16, a: u16) -> Self
pub fn from_u16s(r: u16, g: u16, b: u16, a: u16) -> Self
Create a new RGBA value from 4 u16 values
Sourcepub fn to_u16s(&self) -> (u16, u16, u16, u16)
pub fn to_u16s(&self) -> (u16, u16, u16, u16)
Convert RGBA to 4 u16 values in Gamma corrected 0->65,535 range
Trait Implementations§
Source§impl AddAssign<f64> for RGBA
impl AddAssign<f64> for RGBA
Source§fn add_assign(&mut self, rhs: f64)
fn add_assign(&mut self, rhs: f64)
+= operation. Read moreSource§impl AddAssign for RGBA
impl AddAssign for RGBA
Source§fn add_assign(&mut self, rhs: RGBA)
fn add_assign(&mut self, rhs: RGBA)
+= operation. Read moreSource§impl<'de> Deserialize<'de> for RGBA
impl<'de> Deserialize<'de> for RGBA
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl DivAssign<f64> for RGBA
impl DivAssign<f64> for RGBA
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
/= operation. Read moreSource§impl DivAssign for RGBA
impl DivAssign for RGBA
Source§fn div_assign(&mut self, rhs: RGBA)
fn div_assign(&mut self, rhs: RGBA)
/= operation. Read moreSource§impl<T: Reader> FeatureReader<GeoTIFFMetadata, Map<String, ValueType>, RGBA> for GeoTIFFReader<T>
A feature reader trait with a callback-based approach
impl<T: Reader> FeatureReader<GeoTIFFMetadata, Map<String, ValueType>, RGBA> for GeoTIFFReader<T>
A feature reader trait with a callback-based approach
Source§type FeatureIterator<'a> = GeoTIFFIterator<'a, T>
where
T: 'a
type FeatureIterator<'a> = GeoTIFFIterator<'a, T> where T: 'a
Source§fn iter(&self) -> Self::FeatureIterator<'_>
fn iter(&self) -> Self::FeatureIterator<'_>
Source§impl From<&Map<String, PrimitiveValue>> for RGBA
Starting from a ref to an ValuePrimitive, convert to a struct
impl From<&Map<String, PrimitiveValue>> for RGBA
Starting from a ref to an ValuePrimitive, convert to a struct
Source§fn from(m: &ValuePrimitive) -> Self
fn from(m: &ValuePrimitive) -> Self
Source§impl From<&ValuePrimitiveType> for RGBA
Starting from an ValuePrimitiveType ref, pull out the struct and apply the conversions
impl From<&ValuePrimitiveType> for RGBA
Starting from an ValuePrimitiveType ref, pull out the struct and apply the conversions
Source§fn from(m: &ValuePrimitiveType) -> Self
fn from(m: &ValuePrimitiveType) -> Self
Source§impl From<Map<String, PrimitiveValue>> for RGBA
Starting from an ValuePrimitive, convert to a struct
impl From<Map<String, PrimitiveValue>> for RGBA
Starting from an ValuePrimitive, convert to a struct
Source§fn from(m: ValuePrimitive) -> Self
fn from(m: ValuePrimitive) -> Self
Source§impl From<RGBA> for ValuePrimitive
Starting from a struct, convert to an ValuePrimitive
impl From<RGBA> for ValuePrimitive
Starting from a struct, convert to an ValuePrimitive
Source§fn from(value: RGBA) -> ValuePrimitive
fn from(value: RGBA) -> ValuePrimitive
Source§impl From<RGBA> for ValuePrimitiveType
Starting from a struct, convert to an ValuePrimitiveType for Vec types
impl From<RGBA> for ValuePrimitiveType
Starting from a struct, convert to an ValuePrimitiveType for Vec types
Source§impl From<ValuePrimitiveType> for RGBA
Starting from an ValuePrimitiveType, pull out the struct and apply the conversions
impl From<ValuePrimitiveType> for RGBA
Starting from an ValuePrimitiveType, pull out the struct and apply the conversions
Source§fn from(m: ValuePrimitiveType) -> Self
fn from(m: ValuePrimitiveType) -> Self
Source§impl GetRasterTileValue for RGBA
Available on crate feature std only.
impl GetRasterTileValue for RGBA
std only.Source§impl MulAssign<f64> for RGBA
impl MulAssign<f64> for RGBA
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
*= operation. Read moreSource§impl MulAssign for RGBA
impl MulAssign for RGBA
Source§fn mul_assign(&mut self, rhs: RGBA)
fn mul_assign(&mut self, rhs: RGBA)
*= operation. Read moreimpl Copy for RGBA
impl MValueCompatible for RGBA
impl StructuralPartialEq for RGBA
Auto Trait Implementations§
impl Freeze for RGBA
impl RefUnwindSafe for RGBA
impl Send for RGBA
impl Sync for RGBA
impl Unpin for RGBA
impl UnwindSafe for RGBA
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().