Module blit::slice

source ·
Expand description

Divide the source buffer into multiple sections and repeat the chosen section to fill the area.

§Example

use blit::{BlitOptions, slice::Slice};

// Create a slice 9 type split of a 9x9 image in 3 exact parts
BlitOptions {
   vertical_slice: Some(Slice::ternary(3, 6)),
   horizontal_slice: Some(Slice::ternary(3, 6)),
   ..Default::default()
};

// Although you probably want, note that the right and bottom coordinates are not absolute anymore, here they are the width and height of the center rectangle
BlitOptions::new().with_slice9((3, 3, 3, 3));

Enums§

  • Choose which split of the binary section to scale in a repeating fashion.
  • Divide the source buffer into multiple sections and repeat the chosen section to fill the area.