// Generated by mix skia.codegen. Do not edit by hand.
#![allow(dead_code)]
use rustler::{Atom, NifResult, Term};
use super::{atoms, opt_atom_option, opt_bool_option, opt_f32, opt_f32_option, opt_term};
pub struct RectOpts<'a> {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub radius: Option<f32>,
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_rect_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<RectOpts<'a>> {
Ok(RectOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
width: opt_f32(opts, atoms::width())?,
height: opt_f32(opts, atoms::height())?,
radius: opt_f32_option(opts, atoms::radius())?,
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
_phantom: std::marker::PhantomData,
})
}
pub struct OvalOpts<'a> {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_oval_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<OvalOpts<'a>> {
Ok(OvalOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
width: opt_f32(opts, atoms::width())?,
height: opt_f32(opts, atoms::height())?,
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
_phantom: std::marker::PhantomData,
})
}
pub struct ArcOpts<'a> {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub start_degrees: f32,
pub sweep_degrees: f32,
pub use_center: Option<bool>,
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_arc_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<ArcOpts<'a>> {
Ok(ArcOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
width: opt_f32(opts, atoms::width())?,
height: opt_f32(opts, atoms::height())?,
start_degrees: opt_f32(opts, atoms::start_degrees())?,
sweep_degrees: opt_f32(opts, atoms::sweep_degrees())?,
use_center: opt_bool_option(opts, atoms::use_center())?,
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
_phantom: std::marker::PhantomData,
})
}
pub struct CircleOpts<'a> {
pub x: f32,
pub y: f32,
pub radius: f32,
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_circle_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<CircleOpts<'a>> {
Ok(CircleOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
radius: opt_f32(opts, atoms::radius())?,
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
_phantom: std::marker::PhantomData,
})
}
pub struct VerticesOpts<'a> {
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_vertices_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<VerticesOpts<'a>> {
Ok(VerticesOpts {
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
_phantom: std::marker::PhantomData,
})
}
pub struct LineOpts<'a> {
pub from: Term<'a>,
pub to: Term<'a>,
pub stroke: Term<'a>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_line_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<LineOpts<'a>> {
Ok(LineOpts {
from: opt_term(opts, atoms::from()).ok_or(rustler::Error::BadArg)?,
to: opt_term(opts, atoms::to()).ok_or(rustler::Error::BadArg)?,
stroke: opt_term(opts, atoms::stroke()).ok_or(rustler::Error::BadArg)?,
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
_phantom: std::marker::PhantomData,
})
}
pub struct TextBlobOpts<'a> {
pub x: f32,
pub y: f32,
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_text_blob_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<TextBlobOpts<'a>> {
Ok(TextBlobOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
_phantom: std::marker::PhantomData,
})
}
pub struct TextOpts<'a> {
pub x: f32,
pub y: f32,
pub width: Option<f32>,
pub size: Option<f32>,
pub fill: Option<Term<'a>>,
pub font: Option<Term<'a>>,
pub weight: Option<i64>,
pub align: Option<Atom>,
pub direction: Option<Atom>,
pub font_family: Option<String>,
pub line_height: Option<f32>,
pub spans: Option<Term<'a>>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_text_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<TextOpts<'a>> {
Ok(TextOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
width: opt_f32_option(opts, atoms::width())?,
size: opt_f32_option(opts, atoms::size())?,
fill: opt_term(opts, atoms::fill()),
font: opt_term(opts, atoms::font()),
weight: match opt_term(opts, atoms::weight()) {
Some(term) => Some(term.decode::<i64>()?),
None => None,
},
align: opt_atom_option(opts, atoms::align())?,
direction: opt_atom_option(opts, atoms::direction())?,
font_family: match opt_term(opts, atoms::font_family()) {
Some(term) => Some(term.decode::<String>()?),
None => None,
},
line_height: opt_f32_option(opts, atoms::line_height())?,
spans: opt_term(opts, atoms::spans()),
_phantom: std::marker::PhantomData,
})
}
pub struct ImageOpts<'a> {
pub x: f32,
pub y: f32,
pub width: Option<f32>,
pub height: Option<f32>,
pub source: Option<Term<'a>>,
pub opacity: Option<f32>,
pub sampling: Option<Term<'a>>,
pub blend_mode: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_image_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<ImageOpts<'a>> {
Ok(ImageOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
width: opt_f32_option(opts, atoms::width())?,
height: opt_f32_option(opts, atoms::height())?,
source: opt_term(opts, atoms::source()),
opacity: opt_f32_option(opts, atoms::opacity())?,
sampling: opt_term(opts, atoms::sampling()),
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
_phantom: std::marker::PhantomData,
})
}
pub struct PictureOpts<'a> {
pub x: Option<f32>,
pub y: Option<f32>,
pub opacity: Option<f32>,
pub blend_mode: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_picture_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<PictureOpts<'a>> {
Ok(PictureOpts {
x: opt_f32_option(opts, atoms::x())?,
y: opt_f32_option(opts, atoms::y())?,
opacity: opt_f32_option(opts, atoms::opacity())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
_phantom: std::marker::PhantomData,
})
}
pub struct SaveLayerOpts<'a> {
pub opacity: Option<f32>,
pub bounds: Option<Term<'a>>,
pub blend_mode: Option<Atom>,
pub blur: Option<f32>,
pub image_filter: Option<Term<'a>>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_save_layer_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<SaveLayerOpts<'a>> {
Ok(SaveLayerOpts {
opacity: opt_f32_option(opts, atoms::opacity())?,
bounds: opt_term(opts, atoms::bounds()),
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
blur: opt_f32_option(opts, atoms::blur())?,
image_filter: opt_term(opts, atoms::image_filter()),
_phantom: std::marker::PhantomData,
})
}
pub struct PushStyleOpts<'a> {
pub style: Term<'a>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_push_style_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<PushStyleOpts<'a>> {
Ok(PushStyleOpts {
style: opt_term(opts, atoms::style()).ok_or(rustler::Error::BadArg)?,
_phantom: std::marker::PhantomData,
})
}
pub struct TranslateOpts<'a> {
pub x: f32,
pub y: f32,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_translate_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<TranslateOpts<'a>> {
Ok(TranslateOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
_phantom: std::marker::PhantomData,
})
}
pub struct ScaleOpts<'a> {
pub x: f32,
pub y: f32,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_scale_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<ScaleOpts<'a>> {
Ok(ScaleOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
_phantom: std::marker::PhantomData,
})
}
pub struct RotateOpts<'a> {
pub degrees: f32,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_rotate_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<RotateOpts<'a>> {
Ok(RotateOpts {
degrees: opt_f32(opts, atoms::degrees())?,
_phantom: std::marker::PhantomData,
})
}
pub struct RotateAtOpts<'a> {
pub degrees: f32,
pub x: f32,
pub y: f32,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_rotate_at_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<RotateAtOpts<'a>> {
Ok(RotateAtOpts {
degrees: opt_f32(opts, atoms::degrees())?,
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
_phantom: std::marker::PhantomData,
})
}
pub struct ConcatOpts<'a> {
pub matrix: Term<'a>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_concat_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<ConcatOpts<'a>> {
Ok(ConcatOpts {
matrix: opt_term(opts, atoms::matrix()).ok_or(rustler::Error::BadArg)?,
_phantom: std::marker::PhantomData,
})
}
pub struct PathOpts<'a> {
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
pub fill_rule: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_path_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<PathOpts<'a>> {
Ok(PathOpts {
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
fill_rule: opt_atom_option(opts, atoms::fill_rule())?,
_phantom: std::marker::PhantomData,
})
}
pub struct PathOpOpts<'a> {
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
pub path_op: Atom,
pub fill_rule: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_path_op_opts<'a>(opts: &[(Atom, Term<'a>)]) -> NifResult<PathOpOpts<'a>> {
Ok(PathOpOpts {
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
path_op: opt_atom_option(opts, atoms::path_op())?.ok_or(rustler::Error::BadArg)?,
fill_rule: opt_atom_option(opts, atoms::fill_rule())?,
_phantom: std::marker::PhantomData,
})
}
pub struct PathOutlineOpts<'a> {
pub paint: Option<Term<'a>>,
pub fill: Option<Term<'a>>,
pub stroke: Option<Term<'a>>,
pub stroke_width: Option<f32>,
pub stroke_cap: Option<Atom>,
pub stroke_join: Option<Atom>,
pub stroke_miter: Option<f32>,
pub blend_mode: Option<Atom>,
pub image_filter: Option<Term<'a>>,
pub path_effect: Option<Term<'a>>,
pub color_filter: Option<Term<'a>>,
pub mask_filter: Option<Term<'a>>,
pub outline_width: f32,
pub fill_rule: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_path_outline_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<PathOutlineOpts<'a>> {
Ok(PathOutlineOpts {
paint: opt_term(opts, atoms::paint()),
fill: opt_term(opts, atoms::fill()),
stroke: opt_term(opts, atoms::stroke()),
stroke_width: opt_f32_option(opts, atoms::stroke_width())?,
stroke_cap: opt_atom_option(opts, atoms::stroke_cap())?,
stroke_join: opt_atom_option(opts, atoms::stroke_join())?,
stroke_miter: opt_f32_option(opts, atoms::stroke_miter())?,
blend_mode: opt_atom_option(opts, atoms::blend_mode())?,
image_filter: opt_term(opts, atoms::image_filter()),
path_effect: opt_term(opts, atoms::path_effect()),
color_filter: opt_term(opts, atoms::color_filter()),
mask_filter: opt_term(opts, atoms::mask_filter()),
outline_width: opt_f32(opts, atoms::outline_width())?,
fill_rule: opt_atom_option(opts, atoms::fill_rule())?,
_phantom: std::marker::PhantomData,
})
}
pub struct ClipRectOpts<'a> {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub radius: Option<f32>,
pub antialias: Option<bool>,
pub clip_op: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_clip_rect_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<ClipRectOpts<'a>> {
Ok(ClipRectOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
width: opt_f32(opts, atoms::width())?,
height: opt_f32(opts, atoms::height())?,
radius: opt_f32_option(opts, atoms::radius())?,
antialias: opt_bool_option(opts, atoms::antialias())?,
clip_op: opt_atom_option(opts, atoms::clip_op())?,
_phantom: std::marker::PhantomData,
})
}
pub struct ClipCircleOpts<'a> {
pub x: f32,
pub y: f32,
pub radius: f32,
pub antialias: Option<bool>,
pub clip_op: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_clip_circle_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<ClipCircleOpts<'a>> {
Ok(ClipCircleOpts {
x: opt_f32(opts, atoms::x())?,
y: opt_f32(opts, atoms::y())?,
radius: opt_f32(opts, atoms::radius())?,
antialias: opt_bool_option(opts, atoms::antialias())?,
clip_op: opt_atom_option(opts, atoms::clip_op())?,
_phantom: std::marker::PhantomData,
})
}
pub struct ClipPathOpts<'a> {
pub antialias: Option<bool>,
pub fill_rule: Option<Atom>,
pub clip_op: Option<Atom>,
_phantom: std::marker::PhantomData<&'a ()>,
}
pub fn decode_clip_path_opts<'a>(
opts: &[(Atom, Term<'a>)],
) -> NifResult<ClipPathOpts<'a>> {
Ok(ClipPathOpts {
antialias: opt_bool_option(opts, atoms::antialias())?,
fill_rule: opt_atom_option(opts, atoms::fill_rule())?,
clip_op: opt_atom_option(opts, atoms::clip_op())?,
_phantom: std::marker::PhantomData,
})
}