diff options
Diffstat (limited to 'src/render.rs')
-rw-r--r-- | src/render.rs | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/render.rs b/src/render.rs index 7b796e1..9341848 100644 --- a/src/render.rs +++ b/src/render.rs @@ -7,6 +7,7 @@ use image::{ use imageproc::{drawing, rect::Rect}; use num_traits::{Num, NumCast}; use rusttype::{Font, Scale, SharedBytes}; +use serde::{Deserialize, Serialize}; use std::{error::Error, fmt}; #[derive(Debug)] @@ -43,7 +44,7 @@ impl Error for RenderError { } } -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Alignment { Left, Center, @@ -52,23 +53,23 @@ pub enum Alignment { #[derive(Debug, Clone)] pub struct RenderOptions { - skill_size: u32, - traitline_height: u32, - traitline_width: u32, - traitline_brightness: i32, - traitline_use_gradient: bool, - traitline_gradient_size: u32, - traitline_x_offset: u32, - trait_size: u32, - line_color: Rgba<u8>, - line_height: u32, - font: Font<'static>, - text_color: Rgba<u8>, - text_size: u32, - background_color: Rgba<u8>, - render_specialization_names: bool, - skill_offset: u32, - skill_alignment: Alignment, + pub skill_size: u32, + pub traitline_height: u32, + pub traitline_width: u32, + pub traitline_brightness: i32, + pub traitline_use_gradient: bool, + pub traitline_gradient_size: u32, + pub traitline_x_offset: u32, + pub trait_size: u32, + pub line_color: Rgba<u8>, + pub line_height: u32, + pub font: Font<'static>, + pub text_color: Rgba<u8>, + pub text_size: u32, + pub background_color: Rgba<u8>, + pub render_specialization_names: bool, + pub skill_offset: u32, + pub skill_alignment: Alignment, } impl Default for RenderOptions { |