|
@@ -4,15 +4,15 @@ use crate::errors::IncompleteMappingError;
|
|
use crate::image::{Image, Pixel};
|
|
use crate::image::{Image, Pixel};
|
|
use std::collections::{HashMap, HashSet};
|
|
use std::collections::{HashMap, HashSet};
|
|
|
|
|
|
|
|
+#[derive(Deserialize, Debug)]
|
|
|
|
+pub struct Mapping(pub HashMap<Pixel, String>);
|
|
|
|
+
|
|
#[derive(Deserialize, Debug)]
|
|
#[derive(Deserialize, Debug)]
|
|
struct ColorEntry {
|
|
struct ColorEntry {
|
|
color: Pixel,
|
|
color: Pixel,
|
|
symbol: String,
|
|
symbol: String,
|
|
}
|
|
}
|
|
|
|
|
|
-#[derive(Deserialize, Debug)]
|
|
|
|
-pub struct Mapping(HashMap<Pixel, String>);
|
|
|
|
-
|
|
|
|
impl Mapping {
|
|
impl Mapping {
|
|
pub fn load(
|
|
pub fn load(
|
|
path: impl AsRef<std::path::Path>,
|
|
path: impl AsRef<std::path::Path>,
|