pub struct ImageRenderConfig<'a> {
pub image_size: ImageSize,
pub world_to_model: Matrix3<f32>,
pub pixel_perfect: bool,
pub tile_sizes: TileSizes,
pub threads: Option<&'a ThreadPool>,
pub cancel: CancelToken,
}Expand description
Settings for 2D rendering
Fields§
§image_size: ImageSizeRender size
world_to_model: Matrix3<f32>World-to-model transform
pixel_perfect: boolRender the distance values of individual pixels
tile_sizes: TileSizesTile sizes to use during evaluation.
You’ll likely want to use
RenderHints::tile_sizes_2d
to select this based on evaluator type.
threads: Option<&'a ThreadPool>Thread pool to use for rendering
If this is None, then rendering is done in a single thread; otherwise,
the provided pool is used.
cancel: CancelTokenToken to cancel rendering
Implementations§
Source§impl ImageRenderConfig<'_>
impl ImageRenderConfig<'_>
Sourcepub fn run<F: Function>(&self, shape: Shape<F>) -> Option<Image<DistancePixel>>
pub fn run<F: Function>(&self, shape: Shape<F>) -> Option<Image<DistancePixel>>
Render a shape in 2D using this configuration
Sourcepub fn run_with_vars<F: Function>(
&self,
shape: Shape<F>,
vars: &ShapeVars<f32>,
) -> Option<Image<DistancePixel>>
pub fn run_with_vars<F: Function>( &self, shape: Shape<F>, vars: &ShapeVars<f32>, ) -> Option<Image<DistancePixel>>
Render a shape in 2D using this configuration and variables
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ImageRenderConfig<'a>
impl<'a> !RefUnwindSafe for ImageRenderConfig<'a>
impl<'a> Send for ImageRenderConfig<'a>
impl<'a> Sync for ImageRenderConfig<'a>
impl<'a> Unpin for ImageRenderConfig<'a>
impl<'a> UnsafeUnpin for ImageRenderConfig<'a>
impl<'a> !UnwindSafe for ImageRenderConfig<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.