diff options
author | Daniel Schadt <kingdread@gmx.de> | 2019-12-25 00:58:06 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2019-12-25 00:58:06 +0100 |
commit | a21e3c7b6c8dac839ef8070804580e531faaad69 (patch) | |
tree | 7d0a2528b2bdb75101ce103005141e4ff8ed4465 /src/render.rs | |
parent | 95cc3638cf85774ee311bf4b44b2870a7936400d (diff) | |
parent | 7f2f9b03debc7fc16f9614df7cb6fa4c0999d128 (diff) | |
download | kondou-a21e3c7b6c8dac839ef8070804580e531faaad69.tar.gz kondou-a21e3c7b6c8dac839ef8070804580e531faaad69.tar.bz2 kondou-a21e3c7b6c8dac839ef8070804580e531faaad69.zip |
Merge branch 'user-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 { |