pub struct Flip;Expand description
Mirror an image vertically: the top row becomes the bottom row.
§Access pattern and order
Flip is AccessPattern::Sequential: it reads exactly one input row per
output row, reads no neighbours, and wants full-width strips — square tiles
would buy it nothing. AccessPattern describes tile shape, and on shape
Flip is as sequential as crop.
What Flip reverses is tile order, and that is deliberately not declared
here. Op::input_regions already states the mapping exactly — output
rows y0..y1 come from input rows H-y1..H-y0 — so the scheduler can
derive the order itself and act on it only where it matters: against a
forward-only source it inserts a materialization buffer, and against a
random-access source (tiled TIFF, a memory buffer) it inserts nothing and
the pipeline streams (ADR-0009).
The point is that reversal is a property of the seam, not of this op. A static “always materialize” flag here would force a full-image buffer even where the upstream could serve bands bottom-up perfectly well.
Trait Implementations§
impl Copy for Flip
impl Eq for Flip
Source§impl Op for Flip
impl Op for Flip
Source§fn rescaled(&self) -> Option<Arc<dyn Op>>
fn rescaled(&self) -> Option<Arc<dyn Op>>
A mirror permutes pixels and carries no length, so it means the same thing at any resolution.
Source§fn output_descriptor(
&self,
inputs: &[ImageDescriptor],
) -> Result<ImageDescriptor, PixelsError>
fn output_descriptor( &self, inputs: &[ImageDescriptor], ) -> Result<ImageDescriptor, PixelsError>
Source§fn input_regions(
&self,
output: Region,
inputs: &[ImageDescriptor],
) -> Result<Vec<Region>, PixelsError>
fn input_regions( &self, output: Region, inputs: &[ImageDescriptor], ) -> Result<Vec<Region>, PixelsError>
output. Read more