pub struct CoordinateTransform<D, const MIRROR_X: bool, const MIRROR_Y: bool, const TRANSPOSE: bool> { /* private fields */ }Expand description
A generic coordinate transform that can both mirror along the x and y axes and transpose.
This is a generic implementation of the coordinate transforms for embedded-graphics draw targets. These coordinate transforms can mirror along the x-axis, mirror along the y-axis, and transpose the x and y axes. These operations are always applied in this specific order when enabled.
This coordinate transform can wrap any implementation of DrawTarget. Therefore, it solely
relies on remapping pixel coordinates as they are supplied to draw calls and passing them on
to the wrapped DrawTarget. This means that it cannot use any optimized screen rotation
capabilities that might be available in your display implementation. Optimized implementations
of fill_solid and clear are provided, however fill_contiguous will fall back on the
draw_iter implementation.
Implementations§
Source§impl<D, const MIRROR_X: bool, const MIRROR_Y: bool, const TRANSPOSE: bool> CoordinateTransform<D, MIRROR_X, MIRROR_Y, TRANSPOSE>
impl<D, const MIRROR_X: bool, const MIRROR_Y: bool, const TRANSPOSE: bool> CoordinateTransform<D, MIRROR_X, MIRROR_Y, TRANSPOSE>
Sourcepub fn new(
draw_target: D,
) -> CoordinateTransform<D, MIRROR_X, MIRROR_Y, TRANSPOSE>
pub fn new( draw_target: D, ) -> CoordinateTransform<D, MIRROR_X, MIRROR_Y, TRANSPOSE>
Create a new CoordinateTransform which wraps a supplied DrawTarget.
Sourcepub fn into_inner(self) -> D
pub fn into_inner(self) -> D
Unwraps this CoordinateTransform, returning the underlying DrawTarget.