pub struct Manager {
pub image: RgbaImage,
pub color_file: ColorFile,
pub lookup: HashMap<Rgba<u8>, String>,
}Fields§
§image: RgbaImage§color_file: ColorFile§lookup: HashMap<Rgba<u8>, String>Implementations§
Source§impl Manager
impl Manager
Sourcepub fn new(opts: ManagerOptions) -> Manager
pub fn new(opts: ManagerOptions) -> Manager
Examples found in repository?
More examples
examples/colors.rs (line 8)
3fn main() {
4 let opts = manager::ManagerOptions {
5 image_path: String::from("examples/biomes/biomes.png"),
6 color_file_path: String::from("examples/biomes/colors.ron"),
7 };
8 let manager = manager::Manager::new(opts);
9 for rgb in manager.colors_rgb() {
10 print!("{:?} ", rgb);
11 }
12 for hex in manager.colors_hex() {
13 print!("{:?} ", hex);
14 }
15 println!()
16}examples/color-extraction.rs (line 8)
3fn main() {
4 let opts = manager::ManagerOptions {
5 image_path: String::from("examples/biomes/biomes.png"),
6 color_file_path: String::from("examples/biomes/colors.ron"),
7 };
8 let manager = manager::Manager::new(opts);
9 for rgb in manager.unique_rgb_colors() {
10 print!("{:?} ", rgb);
11 }
12 for hex in manager.unique_hex_colors() {
13 print!("{} ", hex);
14 }
15 println!()
16}pub fn get(&self, x: u32, y: u32) -> PixelData
pub fn hash(&self, x: u32, y: u32) -> u64
Sourcepub fn colors_hex(&self) -> Vec<String>
pub fn colors_hex(&self) -> Vec<String>
Examples found in repository?
examples/colors.rs (line 12)
3fn main() {
4 let opts = manager::ManagerOptions {
5 image_path: String::from("examples/biomes/biomes.png"),
6 color_file_path: String::from("examples/biomes/colors.ron"),
7 };
8 let manager = manager::Manager::new(opts);
9 for rgb in manager.colors_rgb() {
10 print!("{:?} ", rgb);
11 }
12 for hex in manager.colors_hex() {
13 print!("{:?} ", hex);
14 }
15 println!()
16}Sourcepub fn colors_rgb(&self) -> Vec<[u8; 3]>
pub fn colors_rgb(&self) -> Vec<[u8; 3]>
Examples found in repository?
examples/colors.rs (line 9)
3fn main() {
4 let opts = manager::ManagerOptions {
5 image_path: String::from("examples/biomes/biomes.png"),
6 color_file_path: String::from("examples/biomes/colors.ron"),
7 };
8 let manager = manager::Manager::new(opts);
9 for rgb in manager.colors_rgb() {
10 print!("{:?} ", rgb);
11 }
12 for hex in manager.colors_hex() {
13 print!("{:?} ", hex);
14 }
15 println!()
16}Sourcepub fn color_names(&self) -> Vec<String>
pub fn color_names(&self) -> Vec<String>
Sourcepub fn unique_hex_colors(&self) -> Vec<String>
pub fn unique_hex_colors(&self) -> Vec<String>
Examples found in repository?
examples/color-extraction.rs (line 12)
3fn main() {
4 let opts = manager::ManagerOptions {
5 image_path: String::from("examples/biomes/biomes.png"),
6 color_file_path: String::from("examples/biomes/colors.ron"),
7 };
8 let manager = manager::Manager::new(opts);
9 for rgb in manager.unique_rgb_colors() {
10 print!("{:?} ", rgb);
11 }
12 for hex in manager.unique_hex_colors() {
13 print!("{} ", hex);
14 }
15 println!()
16}Sourcepub fn unique_rgb_colors(&self) -> Vec<[u8; 3]>
pub fn unique_rgb_colors(&self) -> Vec<[u8; 3]>
Examples found in repository?
examples/color-extraction.rs (line 9)
3fn main() {
4 let opts = manager::ManagerOptions {
5 image_path: String::from("examples/biomes/biomes.png"),
6 color_file_path: String::from("examples/biomes/colors.ron"),
7 };
8 let manager = manager::Manager::new(opts);
9 for rgb in manager.unique_rgb_colors() {
10 print!("{:?} ", rgb);
11 }
12 for hex in manager.unique_hex_colors() {
13 print!("{} ", hex);
14 }
15 println!()
16}Sourcepub fn show_names(&self)
pub fn show_names(&self)
Auto Trait Implementations§
impl Freeze for Manager
impl RefUnwindSafe for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl UnsafeUnpin for Manager
impl UnwindSafe for Manager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more