From c962748797d2232c7d692e1f5988818505149587 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 12 Mar 2022 18:13:03 +0000 Subject: [PATCH] pub, clone --- src/image.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image.rs b/src/image.rs index 3850c3d..234063f 100644 --- a/src/image.rs +++ b/src/image.rs @@ -4,7 +4,7 @@ use std::fs::read_to_string; use image::{DynamicImage, ImageBuffer}; use crate::Palette; -#[derive(Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct Image { pub name: String, /// colour indices - todo convert to [u8; 64]? @@ -24,7 +24,7 @@ impl Image { Self { name, pixels } } - fn into_image(self, palette: &Palette) -> DynamicImage { + pub fn into_image(self, palette: &Palette) -> DynamicImage { let mut buffer: Vec = Vec::new(); for pixel in self.pixels {