pub, clone

This commit is contained in:
Max Bradbury 2022-03-12 18:13:03 +00:00
parent 4dd334d6a4
commit c962748797
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ use std::fs::read_to_string;
use image::{DynamicImage, ImageBuffer}; use image::{DynamicImage, ImageBuffer};
use crate::Palette; use crate::Palette;
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct Image { pub struct Image {
pub name: String, pub name: String,
/// colour indices - todo convert to [u8; 64]? /// colour indices - todo convert to [u8; 64]?
@ -24,7 +24,7 @@ impl Image {
Self { name, pixels } Self { name, pixels }
} }
fn into_image(self, palette: &Palette) -> DynamicImage { pub fn into_image(self, palette: &Palette) -> DynamicImage {
let mut buffer: Vec<u8> = Vec::new(); let mut buffer: Vec<u8> = Vec::new();
for pixel in self.pixels { for pixel in self.pixels {