pub, clone
This commit is contained in:
parent
4dd334d6a4
commit
c962748797
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue