Table of Contents

Struct MFPPan

Namespace
VisioForge.Core.Types.FastImageProcessing
Assembly
VisioForge.Core.dll

Pan properties.

public struct MFPPan

Inherited Members

Examples

// Example 1: Zoom into the center of a 1920x1080 frame
var zoomIn = new MFPPan
{
    StartX = 0,
    StartY = 0,
    StartWidth = 1920,
    StartHeight = 1080,
    StopX = 480,        // Center horizontally (1920/4)
    StopY = 270,        // Center vertically (1080/4)
    StopWidth = 960,    // Half width
    StopHeight = 540    // Half height
};

// Example 2: Pan from left to right across the frame
var panRight = new MFPPan
{
    StartX = 0,
    StartY = 0,
    StartWidth = 1280,   // Show left 2/3 of frame
    StartHeight = 1080,
    StopX = 640,         // Move to right side
    StopY = 0,
    StopWidth = 1280,    // Show right 2/3 of frame
    StopHeight = 1080
};

// Example 3: Ken Burns effect - slight zoom with diagonal pan
var kenBurns = new MFPPan
{
    StartX = 100,
    StartY = 50,
    StartWidth = 1720,
    StartHeight = 980,
    StopX = 200,
    StopY = 150,
    StopWidth = 1520,
    StopHeight = 855
};

Remarks

The MFPPan structure defines parameters for implementing pan and scan effects on video frames. This effect allows you to create smooth camera movements across a video frame, zooming into specific regions or panning from one area to another. It's commonly used for:

- Creating Ken Burns effects on still images - Focusing on specific regions of interest in video - Simulating camera movements in post-production - Converting between aspect ratios with controlled framing - Creating dynamic presentations from static content

The effect interpolates between a start rectangle (StartX, StartY, StartWidth, StartHeight) and a stop rectangle (StopX, StopY, StopWidth, StopHeight) over the duration of the effect. The interpolation creates smooth motion from the start position/zoom to the end position/zoom.

Fields

StartHeight

The start height.

public int StartHeight

Field Value

int

Remarks

The height of the visible area at the start of the effect in pixels. Smaller values create a zoomed-in effect, while the full frame height shows the entire vertical span. Must be positive and <= frame height.

StartWidth

The start width.

public int StartWidth

Field Value

int

Remarks

The width of the visible area at the start of the effect in pixels. Smaller values create a zoomed-in effect, while the full frame width shows the entire horizontal span. Must be positive and <= frame width.

StartX

The start X.

public int StartX

Field Value

int

Remarks

The horizontal starting position (left edge) of the pan rectangle in pixels. This defines where the visible area begins at the start of the effect. Value should be between 0 and (frame width - StartWidth).

StartY

The start Y.

public int StartY

Field Value

int

Remarks

The vertical starting position (top edge) of the pan rectangle in pixels. This defines where the visible area begins at the start of the effect. Value should be between 0 and (frame height - StartHeight).

StopHeight

The stop height.

public int StopHeight

Field Value

int

Remarks

The height of the visible area at the end of the effect in pixels. If different from StartHeight, creates a zoom in/out effect during the pan. Should maintain aspect ratio with StopWidth for undistorted results.

StopWidth

The stop width.

public int StopWidth

Field Value

int

Remarks

The width of the visible area at the end of the effect in pixels. If different from StartWidth, creates a zoom in/out effect during the pan. Smaller than StartWidth = zoom in, larger = zoom out.

StopX

The stop X.

public int StopX

Field Value

int

Remarks

The horizontal ending position (left edge) of the pan rectangle in pixels. This defines where the visible area ends at the completion of the effect. The effect will smoothly interpolate from StartX to StopX.

StopY

The stop Y.

public int StopY

Field Value

int

Remarks

The vertical ending position (top edge) of the pan rectangle in pixels. This defines where the visible area ends at the completion of the effect. The effect will smoothly interpolate from StartY to StopY.