use crate::*;
#[derive(Clone, Copy, Data, Debug, New, PartialEq, PartialOrd)]
pub struct Camera2D {
#[get(type(copy))]
pub(crate) position: Vector2D,
#[get(type(copy))]
pub(crate) zoom: f64,
#[get(type(copy))]
pub(crate) rotation: f64,
#[get(type(copy))]
pub(crate) viewport_width: f64,
#[get(type(copy))]
pub(crate) viewport_height: f64,
}
#[derive(Clone, Copy, Data, Debug, New, PartialEq, PartialOrd)]
pub struct Camera3D {
#[get(type(copy))]
pub(crate) position: Vector3D,
#[get(type(copy))]
pub(crate) target: Vector3D,
#[get(type(copy))]
#[new(skip)]
pub(crate) up: Vector3D,
#[get(type(copy))]
#[new(skip)]
pub(crate) fov: f64,
#[get(type(copy))]
#[new(skip)]
pub(crate) near: f64,
#[get(type(copy))]
#[new(skip)]
pub(crate) far: f64,
#[get(type(copy))]
pub(crate) viewport_width: f64,
#[get(type(copy))]
pub(crate) viewport_height: f64,
}
#[derive(Clone, Data, New)]
pub struct CanvasRenderer {
pub(crate) context: CanvasRenderingContext2d,
#[get(type(copy))]
pub(crate) camera: Camera2D,
}
#[derive(Clone, Data, Debug, New, PartialEq)]
pub struct LinearGradient {
#[get(type(copy))]
pub(crate) start: Vector2D,
#[get(type(copy))]
pub(crate) end: Vector2D,
pub(crate) stops: Vec<(f64, String)>,
}
#[derive(Clone, Data, Debug, New, PartialEq)]
pub struct RadialGradient {
#[get(type(copy))]
pub(crate) inner_center: Vector2D,
#[get(type(copy))]
pub(crate) inner_radius: f64,
#[get(type(copy))]
pub(crate) outer_center: Vector2D,
#[get(type(copy))]
pub(crate) outer_radius: f64,
pub(crate) stops: Vec<(f64, String)>,
}
#[derive(Clone, Data, Debug, New, PartialEq, PartialOrd)]
pub struct ShadowConfig {
#[get(type(clone))]
pub(crate) color: String,
#[get(type(copy))]
pub(crate) blur: f64,
#[get(type(copy))]
pub(crate) offset_x: f64,
#[get(type(copy))]
pub(crate) offset_y: f64,
}
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, New, Ord, PartialEq, PartialOrd)]
pub struct RenderLayer {
#[get(type(copy))]
pub(crate) z_index: i32,
#[get(type(copy))]
pub(crate) visible: bool,
}
#[derive(Clone, Data, New)]
pub struct SsaaCanvas {
pub(crate) display_canvas: HtmlCanvasElement,
pub(crate) display_context: CanvasRenderingContext2d,
pub(crate) offscreen_canvas: HtmlCanvasElement,
pub(crate) offscreen_context: CanvasRenderingContext2d,
#[get(type(copy))]
pub(crate) scale_factor: f64,
#[get(type(copy))]
pub(crate) width: f64,
#[get(type(copy))]
pub(crate) height: f64,
}