pub enum Slice {
Binary {
split: u32,
repeat: BinarySection,
},
Ternary {
split_first: u32,
split_last: u32,
},
}
Expand description
Divide the source buffer into multiple sections and repeat the chosen section to fill the area.
Variants§
Binary
Fields
repeat: BinarySection
Which of the sections to scale when the area is bigger than the total size.
Split the buffer into two and repeat one of the sections.
Ternary
Fields
Split the buffer into three and repeat the middle section.
If you want to resize either the left or right part a binary section is used.
Implementations§
source§impl Slice
impl Slice
sourcepub fn binary_first<S>(split: S) -> Selfwhere
S: ToPrimitive,
pub fn binary_first<S>(split: S) -> Selfwhere
S: ToPrimitive,
Create a binary split where the first section is scaled.
When horizontal this is the top section. When vertical this is the left section.
sourcepub fn binary_last<S>(split: S) -> Selfwhere
S: ToPrimitive,
pub fn binary_last<S>(split: S) -> Selfwhere
S: ToPrimitive,
Create a binary split where the last section is scaled.
When horizontal this is the bottom section. When vertical this is the right section.
sourcepub fn ternary<S1, S2>(split_first: S1, split_last: S2) -> Selfwhere
S1: ToPrimitive,
S2: ToPrimitive,
pub fn ternary<S1, S2>(split_first: S1, split_last: S2) -> Selfwhere
S1: ToPrimitive,
S2: ToPrimitive,
Create a ternary split where the middle section is scaled.
With both horizontal and vertical this is the middle section.