pub trait AdaptiveEmojiConvert {
// Required method
fn convert_adaptive(&self, negative: bool) -> Self;
}
Expand description
Convert your emoji into adaptive one
Required Methods§
Sourcefn convert_adaptive(&self, negative: bool) -> Self
fn convert_adaptive(&self, negative: bool) -> Self
Converts the pixels of a GrayAlphaImage to negative if negative
is true,
otherwise, converts them to positive.
For Telegram’s adaptive emojis, it doesn’t matter, made to better show what should you use depending on the background.
§Arguments
img
- A mutable reference to a GrayAlphaImage.negative
- A boolean indicating whether to convert to negative or not.
§Examples
use adaptemoji::AdaptiveEmojiConvert;
let mut img = image::open("./assets/examples/original.webp")?.to_luma_alpha8();
let adaptive_img = img.convert_adaptive(true);
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.