Table of Contents

Struct MFPZoom

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

Defines zoom and pan parameters for video frame transformation.

public struct MFPZoom

Inherited Members

Remarks

The MFPZoom structure provides independent horizontal and vertical zoom control combined with pixel-level panning capabilities. This allows for precise frame transformations including digital zoom, aspect ratio correction, and viewport positioning.

Zoom factors are applied multiplicatively to frame dimensions: - Values greater than 1.0 zoom in (magnify) - Values less than 1.0 zoom out (shrink) - Value of 1.0 maintains original size

After zooming, the shift parameters reposition the viewport within the zoomed frame. Positive shift values move the visible area right/down, negative values move it left/up.

Common use cases: - Digital zoom for focusing on specific areas - Aspect ratio correction by applying different X/Y zoom - Image stabilization compensation - Creating picture-in-picture effects - Correcting lens distortion

Fields

ShiftX

Gets or sets the horizontal shift offset in pixels.

public int ShiftX

Field Value

int

Remarks

Horizontal panning offset applied after zooming, in pixels.

Behavior: - 0: Centered horizontally - Positive: Shifts visible area right (shows left portion of zoomed frame) - Negative: Shifts visible area left (shows right portion of zoomed frame)

Maximum useful range depends on zoom level and frame width: MaxShift = (ZoomedWidth - OriginalWidth) / 2

Example for 1920x1080 frame with ZoomX=2.0: - Range: -960 to +960 pixels - ShiftX=0: Shows center portion - ShiftX=480: Shows left quarter - ShiftX=-480: Shows right quarter

ShiftY

Gets or sets the vertical shift offset in pixels.

public int ShiftY

Field Value

int

Remarks

Vertical panning offset applied after zooming, in pixels.

Behavior: - 0: Centered vertically - Positive: Shifts visible area down (shows top portion of zoomed frame) - Negative: Shifts visible area up (shows bottom portion of zoomed frame)

Maximum useful range depends on zoom level and frame height: MaxShift = (ZoomedHeight - OriginalHeight) / 2

Example for 1920x1080 frame with ZoomY=1.5: - Range: -270 to +270 pixels - ShiftY=0: Shows center portion - ShiftY=135: Shows top half - ShiftY=-135: Shows bottom half

ZoomX

Gets or sets the horizontal zoom factor.

public double ZoomX

Field Value

double

Remarks

Controls horizontal magnification of the video frame.

Typical values: - 1.0: Original width (no zoom) - 0.5: Half width (50% zoom out) - 2.0: Double width (200% zoom in) - 1.33: Stretch 4:3 to 16:9 aspect - 0.75: Squeeze 16:9 to 4:3 aspect

For maintaining aspect ratio during zoom, set ZoomX and ZoomY to the same value. For aspect ratio correction, use different values based on the conversion needed.

ZoomY

Gets or sets the vertical zoom factor.

public double ZoomY

Field Value

double

Remarks

Controls vertical magnification of the video frame.

Typical values: - 1.0: Original height (no zoom) - 0.5: Half height (50% zoom out) - 2.0: Double height (200% zoom in)

When combined with ZoomX, enables aspect ratio transformation: - Same as ZoomX: Proportional zoom - Different from ZoomX: Aspect ratio change