Struct agg::raster::RasterizerScanline
source · pub struct RasterizerScanline {
pub clipper: Clip,
pub outline: RasterizerCell,
pub status: PathStatus,
pub x0: i64,
pub y0: i64,
/* private fields */
}
Expand description
Rasterizer Anti-Alias using Scanline
Fields
clipper: Clip
Clipping Region
outline: RasterizerCell
Collection of Rasterizing Cells
status: PathStatus
Status of Path
x0: i64
Current x position
y0: i64
Current y position
Implementations
sourceimpl RasterizerScanline
impl RasterizerScanline
sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset Rasterizer
Reset the RasterizerCell and set PathStatus to Initial
sourcepub fn add_path<VS: VertexSource>(&mut self, path: &VS)
pub fn add_path<VS: VertexSource>(&mut self, path: &VS)
Add a Path
Walks the path from the VertexSource and rasterizes it
sourcepub fn rewind_scanlines(&mut self) -> bool
pub fn rewind_scanlines(&mut self) -> bool
Rewind the Scanline
Close active polygon, sort the Rasterizer Cells, set the scan_y value to the minimum y value and return if any cells are present
sourceimpl RasterizerScanline
impl RasterizerScanline
sourcepub fn gamma<F>(&mut self, gfunc: F)where
F: Fn(f64) -> f64,
pub fn gamma<F>(&mut self, gfunc: F)where
F: Fn(f64) -> f64,
Set the gamma function
Values are set as:
ⓘ
gamma = gfunc( v / mask ) * mask
where v = 0 to 255
sourcepub fn new_with_gamma<F>(gfunc: F) -> Selfwhere
F: Fn(f64) -> f64,
pub fn new_with_gamma<F>(gfunc: F) -> Selfwhere
F: Fn(f64) -> f64,
Create a new RasterizerScanline with a gamma function
See gamma() function for description
sourcepub fn move_to_d(&mut self, x: f64, y: f64)
pub fn move_to_d(&mut self, x: f64, y: f64)
Move to point (x,y)
Sets point as the initial point
sourcepub fn close_polygon(&mut self)
pub fn close_polygon(&mut self)
Close the current polygon
Draw a line from current point to initial “move to” point
sourcepub fn calculate_alpha(&self, area: i64) -> u64
pub fn calculate_alpha(&self, area: i64) -> u64
Calculate alpha term based on area
Trait Implementations
sourceimpl Debug for RasterizerScanline
impl Debug for RasterizerScanline
sourceimpl Default for RasterizerScanline
impl Default for RasterizerScanline
sourcefn default() -> RasterizerScanline
fn default() -> RasterizerScanline
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for RasterizerScanline
impl Send for RasterizerScanline
impl Sync for RasterizerScanline
impl Unpin for RasterizerScanline
impl UnwindSafe for RasterizerScanline
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more