Table of Contents

Class FastImageProcessing

Namespace
VisioForge.Core
Assembly
VisioForge.Core.dll

Fast Image Processing - High-performance image processing operations using native C++ library (VisioForge_MFP.dll/VisioForge_MFP64.dll).

public static class FastImageProcessing

Inheritance

Inherited Members

Remarks

This class provides .NET P/Invoke wrappers around a native C++ library that implements various image processing operations using Intel IPP (Integrated Performance Primitives) for optimal performance.

Supported Image Formats:

  • RGB24: 24-bit color, 3 bytes per pixel (Blue, Green, Red order in memory)
  • RGB32/ARGB: 32-bit color with alpha, 4 bytes per pixel (Blue, Green, Red, Alpha order in memory)

Memory Layout Concepts:

  • IntPtr pixels: Pointer to raw pixel data in memory, representing continuous buffer of color values
  • int width, height: Image dimensions in pixels
  • int stride: Number of bytes per image row (scan line), may include padding for alignment. For RGB24: typically width*3 rounded up. For RGB32: typically width*4
  • Pixel addressing: Pixel at (x,y) is at offset: y * stride + x * bytesPerPixel

Platform Support:

  • x86 (32-bit): Uses VisioForge_MFP.dll via MFPCoreX86 class
  • x64 (64-bit): Uses VisioForge_MFP64.dll via MFPCoreX64 class

Performance Features:

  • Smart multithreading: Automatically parallelizes operations for images larger than 200x200 pixels
  • Intel IPP acceleration: Uses optimized SIMD instructions for fast processing
  • Direct memory manipulation: Operates on raw pixel buffers without managed allocations

C++ Library Location: _SOURCE\MFP\VisioForge_MFP\

Methods

AddScrollingTextLogo(BaseContext, nint, int, int, int, ref VideoEffectScrollingTextLogo, TimeSpan, long)

Adds scrolling text logo.

public static void AddScrollingTextLogo(BaseContext context, nint pixels, int frameWidth, int frameHeight, int frameStride, ref VideoEffectScrollingTextLogo textLogo, TimeSpan timeStamp, long frameNumber)

Parameters

context BaseContext

The context.

pixels nint

Pixels data.

frameWidth int

The frame width.

frameHeight int

The frame height.

frameStride int

The number of bytes per row in the frame buffer.

textLogo VideoEffectScrollingTextLogo

The text logo.

timeStamp TimeSpan

The time stamp.

frameNumber long

Frame number.

Exceptions

ArgumentOutOfRangeException

AddTextLogo(BaseContext, nint, bool, nint, int, int, ref VideoEffectTextLogo, TimeSpan, long)

Adds text logo.

public static void AddTextLogo(BaseContext context, nint pixels, bool pixels32bit, nint pixels32tmp, int frameWidth, int frameHeight, ref VideoEffectTextLogo textLogo, TimeSpan timeStamp, long frameNumber)

Parameters

context BaseContext

The context.

pixels nint

Pixels data.

pixels32bit bool

The pixels 32 bit.

pixels32tmp nint

The pixels32tmp.

frameWidth int

The frame width.

frameHeight int

The frame height.

textLogo VideoEffectTextLogo

The text logo.

timeStamp TimeSpan

The time stamp.

frameNumber long

Frame number.

Exceptions

ArgumentOutOfRangeException

Blue(nint, int, int, bool)

Applies a blue color filter effect to an RGB24 image, removing red and green color channels.

public static void Blue(nint srcPixels, int srcWidth, int srcHeight, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Keeps only the blue channel, sets red and green to 0, creating a blue-tinted monochrome effect.

Pixel Transformation: For each pixel: R=0, G=0, B=unchanged

In-Place Operation: Modifies the source buffer directly without requiring additional memory.

Performance: Smart multithreading divides image into horizontal strips for parallel processing on multiple CPU cores.

Native Implementation: Calls EffectBlue in VisioForge_MFP.dll (C++ VideoEffects.cpp)

Blur(nint, int, int, nint, int)

Applies a blur effect to an RGB24 image using a convolution filter.

public static void Blur(nint srcPixels, int width, int height, nint tmpArray, int tmpArrayLen)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

tmpArray nint

Pointer to temporary working buffer (required for blur algorithm). Must be large enough as specified by tmpArrayLen.

tmpArrayLen int

Size of temporary buffer in bytes. Should be at least width * height * 3 bytes for RGB24.

Remarks

Effect Description: Applies a smoothing/blurring filter by averaging neighboring pixels using convolution.

Algorithm: Uses a kernel-based convolution to create a smooth, blurred appearance.

Temporary Buffer: Requires an external temporary buffer to store intermediate results during processing.

In-Place Operation: Final result is written back to the source buffer.

Native Implementation: Calls EffectBlur in VisioForge_MFP.dll

BlurEx(nint, int, int, int, bool, bool, nint, int)

Applies a directional blur effect to an RGB24 image with control over blur range and direction.

public static void BlurEx(nint srcPixels, int width, int height, int range, bool vertical, bool horizontal, nint tmpArray, int tmpArrayLen)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

range int

Blur intensity/radius (higher values = more blur). Typical range: 1-20.

vertical bool

if set to true, applies vertical blur (top-to-bottom smoothing)

horizontal bool

if set to true, applies horizontal blur (left-to-right smoothing)

tmpArray nint

Pointer to temporary working buffer required for blur algorithm

tmpArrayLen int

Size of temporary buffer in bytes. Should be at least width * height * 3 bytes for RGB24.

Remarks

Directional Control: Can apply blur in vertical, horizontal, or both directions simultaneously.

Motion Blur Effect: Using only vertical or only horizontal creates a motion blur appearance.

Range Parameter: Controls the blur kernel size - larger values create stronger blur but slower processing.

Native Implementation: Calls EffectBlurEx in VisioForge_MFP.dll

Brightness(nint, int, int, int, bool)

Increases the brightness of an RGB24 image by adding a constant value to all color channels.

public static void Brightness(nint srcPixels, int srcWidth, int srcHeight, int amount, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

amount int

Brightness increase amount (0-255). Higher values = brighter image.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Adds the amount value to each RGB color channel, making the entire image lighter.

Algorithm: For each pixel: newR = min(R + amount, 255), newG = min(G + amount, 255), newB = min(B + amount, 255)

Amount Parameter:

  • 0: No change
  • 1-50: Subtle brightness increase
  • 50-100: Moderate brightness increase
  • 100-255: Strong brightness increase (may wash out colors)

Clamping: Values are clamped to 255 to prevent overflow, so very bright areas won't change.

Opposite Effect: Use VisioForge.Core.FastImageProcessing.Darkness(System.IntPtr,System.Int32,System.Int32,System.Int32,System.Boolean) to decrease brightness instead.

Native Implementation: Calls EffectLightness in VisioForge_MFP.dll

ColorNoise(nint, int, int, int, bool)

Adds random color noise to an RGB24 image, creating a colorful grain effect.

public static void ColorNoise(nint srcPixels, int srcWidth, int srcHeight, int amount, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

amount int

Intensity of noise effect (0-255). Higher values = more visible noise.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Adds random variations to each RGB color channel independently, creating colored speckles/grain.

Amount Parameter: Controls the maximum random deviation added to each color channel (0 = no effect, 255 = maximum noise).

Use Cases: Film grain simulation, artistic effects, noise addition for testing denoising algorithms.

Native Implementation: Calls EffectColorNoise in VisioForge_MFP.dll

Contrast(nint, int, int, int, bool)

Adjusts the contrast of an RGB24 image by increasing or decreasing the difference between light and dark areas.

public static void Contrast(nint srcPixels, int srcWidth, int srcHeight, int amount, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

amount int

Contrast adjustment amount (-255 to +255). Positive values increase contrast, negative values decrease contrast, 0 = no change.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Algorithm: Uses the formula: newValue = factor * (oldValue - 128) + 128, where factor depends on amount.

Effect Description: Makes bright pixels brighter and dark pixels darker (positive amount) or reduces the difference (negative amount).

Amount Parameter:

  • Positive (1 to 255): Increases contrast, makes image more vivid
  • Negative (-255 to -1): Decreases contrast, makes image more washed out
  • 0: No change

Native Implementation: Calls EffectContrast in VisioForge_MFP.dll (C++ VideoEffects.cpp)

CopyImagePart(nint, int, int, int, nint, int)

Copies a sub-region of a source image row-by-row into a destination buffer of the same dimensions.

public static void CopyImagePart(nint srcData, int srcStride, int width, int height, nint destData, int destStride)

Parameters

srcData nint

Pointer to the first row of source pixel data.

srcStride int

Bytes per row in the source buffer.

width int

Width of the region in pixels (unused directly — determined by destStride).

height int

Number of rows to copy.

destData nint

Pointer to the first row of the destination buffer.

destStride int

Bytes per row in the destination buffer; determines how many bytes are copied per row.

Crop24(nint, uint, uint, nint, VFRectIntl)

Crops a rectangular region from an RGB24 source image and copies it to an output buffer.

public static void Crop24(nint inPixels, uint inWidth, uint inHeight, nint outPixels, VFRectIntl cutArea)

Parameters

inPixels nint

Pointer to source image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

inWidth uint

Width of source image in pixels

inHeight uint

Height of source image in pixels

outPixels nint

Pointer to output buffer where cropped region will be written (RGB24 format)

cutArea VFRectIntl

Rectangle defining the region to crop (Left, Top, Right, Bottom coordinates)

Remarks

Operation: Extracts a rectangular portion of the source image and copies it to the output buffer.

Output Size: Output buffer must be at least (cutArea.Width * cutArea.Height * 3) bytes.

Cropped Dimensions: Width = cutArea.Right - cutArea.Left, Height = cutArea.Bottom - cutArea.Top

Coordinate System: (0, 0) is top-left corner of source image.

Bounds Checking: cutArea must be within source image bounds, otherwise results are undefined.

Use Cases: Extracting regions of interest, removing borders, creating thumbnails, zoom-in operations.

Performance: Efficient row-by-row memory copy, suitable for real-time processing.

Related: See VisioForge.Core.FastImageProcessing.Crop32(System.IntPtr,System.UInt32,System.UInt32,System.IntPtr,VisioForge.Core.Types.VFRectIntl) for RGB32/ARGB format, VisioForge.Core.FastImageProcessing.ImageCutRGB24(System.IntPtr,System.Int32,System.Int32,System.IntPtr,System.Int32,System.Int32) for simpler interface.

Native Implementation: Calls Crop24 in VisioForge_MFP.dll

Crop32(nint, uint, uint, nint, VFRectIntl)

Crops a rectangular region from an RGB32/ARGB source image and copies it to an output buffer.

public static void Crop32(nint inPixels, uint inWidth, uint inHeight, nint outPixels, VFRectIntl cutArea)

Parameters

inPixels nint

Pointer to source image pixel data (RGB32/ARGB format: 4 bytes per pixel, BGRA order)

inWidth uint

Width of source image in pixels

inHeight uint

Height of source image in pixels

outPixels nint

Pointer to output buffer where cropped region will be written (RGB32 format)

cutArea VFRectIntl

Rectangle defining the region to crop (Left, Top, Right, Bottom coordinates)

Remarks

Operation: Extracts a rectangular portion of the source image and copies it to the output buffer.

Output Size: Output buffer must be at least (cutArea.Width * cutArea.Height * 4) bytes.

Cropped Dimensions: Width = cutArea.Right - cutArea.Left, Height = cutArea.Bottom - cutArea.Top

Coordinate System: (0, 0) is top-left corner of source image.

Bounds Checking: cutArea must be within source image bounds, otherwise results are undefined.

Use Cases: Extracting regions of interest, removing borders, preparing thumbnails, focus on specific image areas.

Performance: Fast memory copy operation, suitable for real-time video processing.

Related: See VisioForge.Core.FastImageProcessing.Crop24(System.IntPtr,System.UInt32,System.UInt32,System.IntPtr,VisioForge.Core.Types.VFRectIntl) for RGB24 format, VisioForge.Core.FastImageProcessing.ImageCutRGB32(System.IntPtr,System.Int32,System.Int32,System.IntPtr,System.Int32,System.Int32) for simpler interface.

Native Implementation: Calls Crop32 in VisioForge_MFP.dll

Darkness(nint, int, int, int, bool)

Decreases the brightness of an RGB24 image by subtracting a constant value from all color channels.

public static void Darkness(nint srcPixels, int srcWidth, int srcHeight, int amount, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

amount int

Brightness decrease amount (0-255). Higher values = darker image.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Subtracts the amount value from each RGB color channel, making the entire image darker.

Algorithm: For each pixel: newR = max(R - amount, 0), newG = max(G - amount, 0), newB = max(B - amount, 0)

Amount Parameter:

  • 0: No change
  • 1-50: Subtle darkness increase
  • 50-100: Moderate darkness increase
  • 100-255: Strong darkness increase (may make image nearly black)

Clamping: Values are clamped to 0 to prevent underflow, so very dark areas become black.

Opposite Effect: Use VisioForge.Core.FastImageProcessing.Brightness(System.IntPtr,System.Int32,System.Int32,System.Int32,System.Boolean) to increase brightness instead.

Native Implementation: Calls EffectDarkness in VisioForge_MFP.dll

DeinterlaceBlend(HistoryFrame, nint, int, int, int, int, MFPDeinterlaceBlend)

Applies blend-based deinterlacing using three consecutive fields/frames to remove interlacing artifacts.

public static void DeinterlaceBlend(HistoryFrame historyFrame, nint output, int width, int height, int srcPitch, int destPitch, MFPDeinterlaceBlend deintBlend)

Parameters

historyFrame HistoryFrame

HistoryFrame object containing three consecutive frames (Frame0=previous, Frame1=current, Frame2=next)

output nint

Pointer to output buffer for deinterlaced frame. Must be at least width * height * 3 bytes.

width int

Width of frames in pixels

height int

Height of frames in pixels

srcPitch int

Stride (bytes per row) for source frames. Typically width * 3 for RGB24.

destPitch int

Stride (bytes per row) for output frame. Typically width * 3 for RGB24.

deintBlend MFPDeinterlaceBlend

Deinterlacing blend parameters structure containing blend mode and strength settings

Remarks

Blend Deinterlacing: Uses temporal blending of three consecutive frames to reconstruct missing scan lines.

Algorithm:

  1. Identifies which scan lines belong to which field (odd vs even)
  2. For missing lines, blends corresponding lines from previous and next frames
  3. Applies weighted average based on motion detection and blend parameters
  4. Preserves original scan lines, only interpolates missing ones

Blend Modes: Different blending strategies can be specified in deintBlend parameter:

  • Simple average: (Frame0 + Frame2) / 2 for missing lines
  • Weighted blend: Frame1 contributes more for static areas
  • Motion-adaptive: Adjusts blend based on detected motion

Quality Trade-offs:

  • Better than single-frame methods for static content
  • Can cause ghosting/blur with fast motion
  • Good balance between quality and computational cost

Use Cases: Deinterlacing video from broadcast, DVD, VHS; converting interlaced to progressive scan.

Requirements: Requires 3-frame buffer (current + adjacent frames).

Native Implementation: Calls EffectDeinterlaceBlend in VisioForge_MFP.dll

DeinterlaceCAVT(nint, int, int, nint, int)

Applies CAVT (Content Adaptive Vertical Temporal) deinterlacing to remove interlacing artifacts from video frames.

public static void DeinterlaceCAVT(nint srcPixels, int width, int height, nint temp, int threshold)

Parameters

srcPixels nint

Pointer to interlaced frame pixel data (RGB24 format: 3 bytes per pixel, BGR order). Frame is modified in-place.

width int

Width of frame in pixels

height int

Height of frame in pixels

temp nint

Pointer to temporary working buffer. Must be at least width * height * 3 bytes.

threshold int

Motion detection threshold (0-255). Higher values = more aggressive deinterlacing. Typical range: 10-50.

Remarks

Interlacing Background: Interlaced video contains two fields (odd/even scan lines) captured at different times, causing combing artifacts on moving objects.

CAVT Algorithm:

  • Analyzes vertical and temporal differences between scan lines
  • Detects motion using threshold parameter
  • Adaptively blends or interpolates pixels to remove combing while preserving detail

Threshold Parameter:

  • Low values (5-15): Less aggressive, preserves more original detail, may leave slight combing
  • Medium values (15-35): Balanced approach, removes most combing
  • High values (35-100): Very aggressive, removes all combing but may blur fine details

Use Case: Deinterlacing broadcast video, VHS captures, or any interlaced source material.

Native Implementation: Calls EffectDeinterlaceCAVT in VisioForge_MFP.dll

DeinterlaceTriangle(nint, int, int, nint, int)

Applies Triangle deinterlacing using weighted interpolation between scan lines.

public static void DeinterlaceTriangle(nint srcPixels, int width, int height, nint temp, int weight)

Parameters

srcPixels nint

Pointer to interlaced frame pixel data (RGB24 format: 3 bytes per pixel, BGR order). Frame is modified in-place.

width int

Width of frame in pixels

height int

Height of frame in pixels

temp nint

Pointer to temporary working buffer. Must be at least width * height * 3 bytes.

weight int

Interpolation weight (0-100). Controls blending between adjacent scan lines. 50 = equal weighting.

Remarks

Triangle Deinterlacing: Uses weighted average of neighboring scan lines to interpolate missing field data.

Algorithm:

  • For each scan line from one field, interpolates from adjacent lines in the other field
  • Uses triangle-shaped weighting kernel (closer lines have more influence)
  • Weight parameter controls the interpolation curve

Weight Parameter:

  • 0: Uses only current field (no interpolation)
  • 50: Equal blending of adjacent lines (standard linear interpolation)
  • 100: Maximum interpolation from neighboring lines

Quality Trade-off: Simpler than CAVT but may blur static areas. Good for motion-heavy content.

Native Implementation: Calls EffectDeinterlaceTriangle in VisioForge_MFP.dll

DenoiseAdaptive(HistoryFrame, nint, int, int, int, int, byte, byte)

Applies adaptive temporal noise reduction using three consecutive video frames with threshold-based filtering.

public static void DenoiseAdaptive(HistoryFrame historyFrame, nint output, int width, int height, int srcPitch, int destPitch, byte threshold, byte blurType)

Parameters

historyFrame HistoryFrame

HistoryFrame object containing three consecutive frames (Frame0=previous, Frame1=current, Frame2=next)

output nint

Pointer to output buffer for denoised frame. Must be at least width * height * 3 bytes.

width int

Width of frames in pixels

height int

Height of frames in pixels

srcPitch int

Stride (bytes per row) for source frames. Typically width * 3 for RGB24.

destPitch int

Stride (bytes per row) for output frame. Typically width * 3 for RGB24.

threshold byte

Motion detection threshold (0-255). Higher values = more aggressive denoising. Typical: 10-30.

blurType byte

Type of blur to apply (0=none, 1=light, 2=medium, 3=strong). Controls spatial smoothing strength.

Remarks

Adaptive Temporal Denoising: Uses three consecutive frames to distinguish between noise and actual motion/detail.

Algorithm:

  1. Compares Frame1 (current) with Frame0 (previous) and Frame2 (next)
  2. If pixel difference between frames < threshold: likely noise, apply temporal averaging
  3. If pixel difference > threshold: likely motion/detail, preserve original value
  4. Optionally applies spatial blur based on blurType for additional smoothing

Threshold Parameter:

  • 5-15: Conservative, preserves most motion, removes minimal noise
  • 15-30: Balanced, good for typical video noise
  • 30-50: Aggressive, strong denoising, may blur fast motion

Blur Type:

  • 0: No spatial blur (temporal only)
  • 1: Light blur (subtle smoothing)
  • 2: Medium blur (moderate smoothing)
  • 3: Strong blur (heavy smoothing, may lose fine detail)

Use Cases: Video noise reduction, improving compressed video quality, cleaning surveillance footage, reducing sensor noise.

Advantages: Preserves edges and motion better than single-frame denoisers; removes temporal noise effectively.

Requirements: Must maintain 3-frame buffer. Best for sequences with moderate motion.

Native Implementation: Calls EffectDenoiseAdaptive in VisioForge_MFP.dll

DenoiseCAST(nint, nint, int, int, int, MFPDenoiseCAST)

Applies CAST (Coupled Anisotropic Spatial Temporal) noise reduction using current and previous frames with Intel IPP.

public static void DenoiseCAST(nint frame, nint prevFrame, int width, int height, int srcPitch, MFPDenoiseCAST denoiseCAST)

Parameters

frame nint

Pointer to current frame pixel data (RGB24 format: 3 bytes per pixel, BGR order). Frame is denoised in-place.

prevFrame nint

Pointer to previous frame pixel data for temporal comparison. Must be same size and format as current frame.

width int

Width of frames in pixels

height int

Height of frames in pixels

srcPitch int

Stride (bytes per row) for both frames. Typically width * 3 for RGB24.

denoiseCAST MFPDenoiseCAST

CAST denoising parameters structure containing threshold and algorithm settings

Remarks

CAST Algorithm: Advanced temporal denoising using Intel IPP that analyzes both spatial (within frame) and temporal (between frames) information.

How It Works:

  1. Detects edges in current frame using edge detection
  2. Compares current frame with previous frame to identify static vs moving areas
  3. Applies stronger denoising to static areas (temporal filtering)
  4. Preserves edges and moving areas to avoid motion blur

Anisotropic: Applies different filtering strengths in different directions to preserve edges while removing noise.

Coupled: Combines spatial filtering (within frame) with temporal filtering (across frames) for superior results.

Use Cases: Video denoising for surveillance footage, low-light video enhancement, cleaning up compressed video artifacts.

Requirements: Requires storing previous frame for temporal comparison. Best results with static camera or minimal motion.

Performance: More computationally expensive than single-frame denoisers due to temporal analysis.

Native Implementation: Calls EffectDenoiseCAST in VisioForge_MFP.dll (uses Intel IPP ippiFilterDenoiseCAST functions)

DenoiseMosquito(HistoryFrame, nint, int, int, int, int)

Removes mosquito noise artifacts using three consecutive frames with temporal filtering.

public static void DenoiseMosquito(HistoryFrame historyFrame, nint output, int width, int height, int srcPitch, int destPitch)

Parameters

historyFrame HistoryFrame

HistoryFrame object containing three consecutive frames (Frame0=previous, Frame1=current, Frame2=next)

output nint

Pointer to output buffer for denoised frame. Must be at least width * height * 3 bytes.

width int

Width of frames in pixels

height int

Height of frames in pixels

srcPitch int

Stride (bytes per row) for source frames. Typically width * 3 for RGB24.

destPitch int

Stride (bytes per row) for output frame. Typically width * 3 for RGB24.

Remarks

Mosquito Noise: Characteristic artifact of lossy video compression (MPEG, H.264) appearing as shimmering dots or patterns around edges.

Artifact Characteristics:

  • Appears as crawling or shimmering patterns near high-contrast edges
  • Caused by quantization errors in DCT coefficients
  • Temporal: Changes frame-to-frame even in static scenes
  • Most visible in flat areas adjacent to sharp edges

Algorithm:

  1. Detects edges in current frame (Frame1)
  2. Identifies potential mosquito noise near edges using temporal analysis
  3. Compares Frame1 with Frame0 and Frame2 to distinguish noise from real detail
  4. Applies temporal smoothing only to identified noise patterns
  5. Preserves actual edges and details

Use Cases:

  • Cleaning up heavily compressed video (low bitrate MPEG, web video)
  • Improving visual quality of streaming content
  • Post-processing for video conferencing
  • Archival restoration of compressed video

Requirements: Requires 3-frame buffer for temporal analysis.

Limitations: Most effective on static or slowly moving scenes; fast motion may reduce effectiveness.

Native Implementation: Calls EffectDenoiseMosquito in VisioForge_MFP.dll

DenoiseSNR(nint, int, int, nint, int)

Applies SNR (Signal-to-Noise Ratio) based noise reduction to an RGB24 image.

public static void DenoiseSNR(nint srcPixels, int width, int height, nint temp, int threshold)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

temp nint

Pointer to temporary working buffer. Must be at least width * height * 3 bytes.

threshold int

Noise threshold (0-255). Higher values = more aggressive denoising. Typical range: 10-50.

Remarks

SNR Denoising: Reduces random noise while preserving edges and details based on signal-to-noise analysis.

Algorithm:

  • Analyzes local pixel variations to distinguish noise from actual image features
  • Applies smoothing only in areas identified as noisy (low signal-to-noise ratio)
  • Preserves sharp edges and high-contrast features

Threshold Parameter:

  • Low (5-15): Mild denoising, preserves maximum detail, removes minimal noise
  • Medium (15-35): Balanced noise reduction, good for typical camera noise
  • High (35-100): Strong denoising, may blur fine textures

Use Cases: Cleaning up digital camera noise, low-light video, compressed video artifacts.

Native Implementation: Calls EffectDenoiseSNR in VisioForge_MFP.dll

DrawX_ARGBOnARGB_SLOW(VideoFrameX, Rect, VideoFrameX, int, int)

Composites an ARGB source sub-rectangle onto an ARGB destination frame using per-pixel alpha blending. This overload accepts VisioForge.Core.Types.X.VideoFrameX wrapper objects for convenience.

public static void DrawX_ARGBOnARGB_SLOW(VideoFrameX inFrame, Rect inRect, VideoFrameX destFrame, int destX, int destY)

Parameters

inFrame VideoFrameX

Source ARGB frame.

inRect Rect

Sub-rectangle within inFrame to composite.

destFrame VideoFrameX

Destination ARGB frame that receives the blended result.

destX int

Horizontal offset in the destination frame where the source rectangle is placed.

destY int

Vertical offset in the destination frame where the source rectangle is placed.

DrawX_ARGBOnARGB_SLOW(nint, int, int, int, nint, int, int, int, int, int, int, int, int, int)

Composites an ARGB source sub-rectangle onto an ARGB destination frame using per-pixel alpha blending. This overload operates on raw pixel data pointers.

public static void DrawX_ARGBOnARGB_SLOW(nint srcData, int srcWidth, int srcHeight, int srcStride, nint destData, int destWidth, int destHeight, int destStride, int srcX, int srcY, int destX, int destY, int width, int height)

Parameters

srcData nint

Pointer to source image pixel data (ARGB format).

srcWidth int

Width of the source image in pixels.

srcHeight int

Height of the source image in pixels.

srcStride int

Bytes per row in the source image.

destData nint

Pointer to destination image pixel data (ARGB format).

destWidth int

Width of the destination image in pixels.

destHeight int

Height of the destination image in pixels.

destStride int

Bytes per row in the destination image.

srcX int

Horizontal offset within the source image for the copy region.

srcY int

Vertical offset within the source image for the copy region.

destX int

Horizontal offset in the destination frame where the source is placed.

destY int

Vertical offset in the destination frame where the source is placed.

width int

Width of the region to composite in pixels.

height int

Height of the region to composite in pixels.

Draw_RGB24OnRGB24Old(nint, int, int, nint, int, int, int, int)

Draws (composites) an RGB24 source image onto an RGB24 destination image at specified coordinates (legacy version without stride parameter).

public static void Draw_RGB24OnRGB24Old(nint srcPixels, int srcWidth, int srcHeight, nint destPixels, int destWidth, int destHeight, int x, int y)

Parameters

srcPixels nint

Pointer to source image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

srcWidth int

Width of source image in pixels

srcHeight int

Height of source image in pixels

destPixels nint

Pointer to destination image pixel data (RGB24 format)

destWidth int

Width of destination image in pixels

destHeight int

Height of destination image in pixels

x int

X coordinate in destination image where top-left corner of source will be placed

y int

Y coordinate in destination image where top-left corner of source will be placed

Remarks

Legacy Method: This is an older version that assumes standard stride (width * 3 for RGB24).

For better control over memory layout, use VisioForge.Core.FastImageProcessing.Draw_RGB24OnRGB24S(System.IntPtr,System.Int32,System.Int32,System.Int32,System.IntPtr,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32) which accepts stride parameters.

Native Implementation: Calls Draw_RGB24OnRGB24 in VisioForge_MFP.dll

Draw_RGB24OnRGB24S(nint, int, int, int, nint, int, int, int, int, int)

Draws (composites) an RGB24 source image onto an RGB24 destination image at specified coordinates.

public static void Draw_RGB24OnRGB24S(nint srcPixels, int srcWidth, int srcHeight, int srcStride, nint destPixels, int destWidth, int destHeight, int destStride, int x, int y)

Parameters

srcPixels nint

Pointer to source image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

srcWidth int

Width of source image in pixels

srcHeight int

Height of source image in pixels

srcStride int

Number of bytes per row in source image (typically width * 3, may include padding)

destPixels nint

Pointer to destination image pixel data (RGB24 format)

destWidth int

Width of destination image in pixels

destHeight int

Height of destination image in pixels

destStride int

Number of bytes per row in destination image

x int

X coordinate in destination image where top-left corner of source will be placed

y int

Y coordinate in destination image where top-left corner of source will be placed

Remarks

Operation: Copies source image pixels directly onto destination image without alpha blending.

Memory Format: RGB24 uses 3 bytes per pixel in BGR order (Blue byte, Green byte, Red byte)

Clipping: If source extends beyond destination boundaries, it will be automatically clipped

Performance: Uses optimized native code with SIMD instructions for fast pixel copying

Native Implementation: Calls Draw_RGB24OnRGB24S in VisioForge_MFP.dll (C++ VideoEffects.cpp)

Draw_RGB24OnRGB24_Transp(nint, int, int, nint, int, int, int, int, int)

Draws the RGB24 image on RGB24 image with transparency.

public static void Draw_RGB24OnRGB24_Transp(nint srcPixels, int srcWidth, int srcHeight, nint destPixels, int destWidth, int destHeight, int x, int y, int transp)

Parameters

srcPixels nint

The source pixels.

srcWidth int

Width of the source.

srcHeight int

Height of the source.

destPixels nint

The dest pixels.

destWidth int

Width of the dest.

destHeight int

Height of the dest.

x int

The x.

y int

The y.

transp int

The transp.

Draw_RGB24OnRGB32(nint, int, int, nint, int, int, int, int)

Draws (composites) an RGB24 source image onto an RGB32 destination image at specified coordinates.

public static void Draw_RGB24OnRGB32(nint srcPixels, int srcWidth, int srcHeight, nint destPixels, int destWidth, int destHeight, int x, int y)

Parameters

srcPixels nint

Pointer to source image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

srcWidth int

Width of source image in pixels

srcHeight int

Height of source image in pixels

destPixels nint

Pointer to destination image pixel data (RGB32/ARGB format: 4 bytes per pixel, BGRA order)

destWidth int

Width of destination image in pixels

destHeight int

Height of destination image in pixels

x int

X coordinate in destination image where top-left corner of source will be placed

y int

Y coordinate in destination image where top-left corner of source will be placed

Remarks

Format Conversion: Converts RGB24 (3 bytes/pixel) to RGB32 (4 bytes/pixel) during compositing.

Alpha Channel: The alpha channel in destination will be set to fully opaque (255) for drawn pixels.

Memory Format: RGB24 = BGR, RGB32 = BGRA (Blue, Green, Red, Alpha bytes)

Native Implementation: Calls Draw_RGB24OnRGB32 in VisioForge_MFP.dll

Draw_RGB24_TraspChange(nint, int, int, int)

Change the RGB24 image transparency.

public static void Draw_RGB24_TraspChange(nint pixels, int width, int height, int transp)

Parameters

pixels nint

The data.

width int

The width.

height int

The height.

transp int

The transparency.

Draw_RGB32OnRGB24(nint, int, int, nint, int, int, int, int, bool)

Draws (composites) an RGB32/ARGB source image onto an RGB24 destination image with alpha blending and optional smart multithreading.

public static void Draw_RGB32OnRGB24(nint srcPixels, int srcWidth, int srcHeight, nint destPixels, int destWidth, int destHeight, int x, int y, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to source image pixel data (RGB32/ARGB format: 4 bytes per pixel, BGRA order with alpha channel)

srcWidth int

Width of source image in pixels

srcHeight int

Height of source image in pixels

destPixels nint

Pointer to destination image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

destWidth int

Width of destination image in pixels

destHeight int

Height of destination image in pixels

x int

X coordinate in destination image where top-left corner of source will be placed

y int

Y coordinate in destination image where top-left corner of source will be placed

smartMultithreading bool

if set to true, automatically uses parallel processing for large images (> 200x200 pixels)

Remarks

Alpha Blending: Uses the alpha channel from source RGB32 image to blend with destination RGB24.

Format Conversion: Converts RGB32 (4 bytes/pixel with alpha) to RGB24 (3 bytes/pixel) with blending.

Smart Multithreading: When enabled and image is large enough, divides work across CPU cores for faster processing.

Memory Layout: Automatically calculates stride as width * 4 for RGB32, width * 3 for RGB24.

Internally calls VisioForge.Core.FastImageProcessing.Draw_RGB32OnRGB24S(System.IntPtr,System.Int32,System.Int32,System.Int32,System.IntPtr,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean) with calculated stride values.

Draw_RGB32OnRGB24POS(nint, int, int, int, int, int, nint, int, int, int, int, int)

Draws (composites) a portion of RGB32/ARGB source image onto an RGB24 destination image with position control.

public static void Draw_RGB32OnRGB24POS(nint inPixels, int inWidth, int inHeight, int inStride, int srcX, int srcY, nint destPixels, int destWidth, int destHeight, int destStride, int destX, int destY)

Parameters

inPixels nint

Pointer to source image pixel data (RGB32/ARGB format: 4 bytes per pixel, BGRA order)

inWidth int

Width of entire source image in pixels

inHeight int

Height of entire source image in pixels

inStride int

Number of bytes per row in source image (typically width * 4)

srcX int

X coordinate in source image to start reading from

srcY int

Y coordinate in source image to start reading from

destPixels nint

Pointer to destination image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

destWidth int

Width of entire destination image in pixels

destHeight int

Height of entire destination image in pixels

destStride int

Number of bytes per row in destination image (typically width * 3)

destX int

X coordinate in destination image where source portion will be placed

destY int

Y coordinate in destination image where source portion will be placed

Remarks

Partial Image Compositing: Allows compositing a specific region from source to a specific position in destination.

Use Case: Useful for tiling, sprite rendering, or combining image regions.

Alpha Blending: Uses alpha channel from source for proper transparency blending.

Native Implementation: Calls Draw_RGB32OnRGB24POS in VisioForge_MFP.dll

Draw_RGB32OnRGB24S(nint, int, int, int, nint, int, int, int, int, int, bool)

Draws (composites) an RGB32/ARGB source image onto an RGB24 destination image with alpha blending and smart multithreading support.

public static void Draw_RGB32OnRGB24S(nint srcPixels, int srcWidth, int srcHeight, int srcStride, nint destPixels, int destWidth, int destHeight, int destStride, int x, int y, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to source image pixel data (RGB32/ARGB format: 4 bytes per pixel, BGRA order with alpha channel)

srcWidth int

Width of source image in pixels

srcHeight int

Height of source image in pixels

srcStride int

Number of bytes per row in source image (typically width * 4, may include padding for alignment)

destPixels nint

Pointer to destination image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

destWidth int

Width of destination image in pixels

destHeight int

Height of destination image in pixels

destStride int

Number of bytes per row in destination image (typically width * 3, may include padding)

x int

X coordinate in destination image where top-left corner of source will be placed

y int

Y coordinate in destination image where top-left corner of source will be placed

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Smart Multithreading Implementation:

  • For small images (< 40,000 pixels): Single-threaded processing
  • For large images: Divides image into horizontal bands, one per CPU core
  • Uses System.Threading.Tasks.Parallel.For for parallel band processing
  • Handles remainder pixels if image height not evenly divisible by thread count

Alpha Blending: Uses alpha channel (4th byte) from source to blend with destination RGB values.

Automatic Clipping: Source is automatically clipped if it extends beyond destination boundaries.

Native Implementation: Calls Draw_RGB32OnRGB24S in VisioForge_MFP.dll (uses Intel IPP for SIMD acceleration)

Draw_RGB32OnRGB24SX(nint, Rect, int, nint, int, int, int, int, int)

Draws the RGB32 image on RGB24 image.

public static void Draw_RGB32OnRGB24SX(nint srcPixels, Rect srcRect, int srcStride, nint destPixels, int destWidth, int destHeight, int destStride, int x, int y)

Parameters

srcPixels nint

The source data.

srcRect Rect

The rectangular region of the source image to draw.

srcStride int

The source stride.

destPixels nint

The destination data.

destWidth int

Width of the destination.

destHeight int

Height of the destination.

destStride int

The destination stride.

x int

The x.

y int

The y.

Draw_RGB32OnRGB24_Transp(nint, int, int, nint, int, int, int, int, int)

Draws the RGB32 image on RGB24 image with transparency.

public static void Draw_RGB32OnRGB24_Transp(nint srcPixels, int srcWidth, int srcHeight, nint destPixels, int destWidth, int destHeight, int x, int y, int transp)

Parameters

srcPixels nint

The source data.

srcWidth int

Width of the source.

srcHeight int

Height of the source.

destPixels nint

The destination data.

destWidth int

Width of the destination.

destHeight int

Height of the destination.

x int

The x.

y int

The y.

transp int

The transparency.

Draw_RGB32OnRGB32(nint, int, int, nint, int, int, int, int, nint, int, int)

Draws the RGB32 image on RGB32 image.

public static void Draw_RGB32OnRGB32(nint srcPixels, int srcWidth, int srcHeight, nint destPixels, int destWidth, int destHeight, int x, int y, nint tmpPixels, int tmpWidth, int tmpHeight)

Parameters

srcPixels nint

The source data.

srcWidth int

Width of the source.

srcHeight int

Height of the source.

destPixels nint

The destination data.

destWidth int

Width of the destination.

destHeight int

Height of the destination.

x int

The x.

y int

The y.

tmpPixels nint

The temporary data.

tmpWidth int

Width of the temporary data.

tmpHeight int

Height of the temporary data.

FadeInOut(nint, int, int, long, long, long, bool)

Applies a fade-in or fade-out effect to an RGB24 image based on time position within a time range.

public static void FadeInOut(nint data, int width, int height, long startTime, long stopTime, long currentTime, bool fadeIn)

Parameters

data nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

startTime long

Start time of fade effect in ticks or milliseconds (beginning of fade range)

stopTime long

End time of fade effect in ticks or milliseconds (end of fade range)

currentTime long

Current time position in ticks or milliseconds (must be between startTime and stopTime)

fadeIn bool

if set to true, applies fade-in (from black to full brightness); otherwise fade-out (from full brightness to black)

Remarks

Fade Effect: Gradually adjusts image brightness over time to create smooth transitions.

Algorithm:

  1. Calculates progress: progress = (currentTime - startTime) / (stopTime - startTime), range 0.0 to 1.0
  2. For fade-in: multiplier = progress (0.0 = black, 1.0 = full)
  3. For fade-out: multiplier = (1.0 - progress) (1.0 = full, 0.0 = black)
  4. Multiplies each RGB channel by multiplier: newValue = oldValue * multiplier

Fade-In Behavior:

  • At startTime: Image is completely black (all pixels = 0)
  • Between times: Image gradually brightens proportionally
  • At stopTime: Image is at full original brightness

Fade-Out Behavior:

  • At startTime: Image is at full original brightness
  • Between times: Image gradually darkens proportionally
  • At stopTime: Image is completely black (all pixels = 0)

Time Units: Time values should use consistent units (all milliseconds or all ticks). Only relative differences matter.

Clamping: If currentTime is outside [startTime, stopTime] range, effect will clamp to nearest endpoint (fully bright or fully dark).

Use Cases: Video transitions, scene changes, title sequences, end credits, crossfades (combined with compositing).

Performance: Simple per-pixel multiplication, suitable for real-time video processing.

Native Implementation: Calls EffectFadeInOut in VisioForge_MFP.dll

FillColor(nint, int, int, VFRectIntl, int)

Fills a rectangular region in an RGB24 image with a solid color.

public static void FillColor(nint inPixels, int inWidth, int inHeight, VFRectIntl area, int color)

Parameters

inPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

inWidth int

Width of entire image in pixels

inHeight int

Height of entire image in pixels

area VFRectIntl

Rectangle defining the region to fill (Left, Top, Right, Bottom coordinates)

color int

Fill color as COLORREF value (0x00BBGGRR format: low byte = Blue, middle = Green, high = Red)

Remarks

Operation: Sets all pixels within the specified rectangle to the given color.

Color Format: COLORREF uses Windows BGR format (0x00BBGGRR):

  • Red = (color & 0x0000FF)
  • Green = (color & 0x00FF00) >> 8
  • Blue = (color & 0xFF0000) >> 16

Common Colors:

  • 0x000000: Black
  • 0xFFFFFF: White
  • 0x0000FF: Red
  • 0x00FF00: Green
  • 0xFF0000: Blue

Area Clipping: If rectangle extends beyond image bounds, it's automatically clipped to image size.

Use Cases: Drawing solid rectangles, clearing regions, creating color bars, masking areas, adding colored overlays.

Performance: Fast memory fill operation using optimized routines.

Native Implementation: Calls FillColor in VisioForge_MFP.dll

FilterBlue(nint, int, int, int, int, bool)

Filters the blue color channel by setting it to 0 if outside specified range, creating selective blue channel filtering.

public static void FilterBlue(nint srcPixels, int srcWidth, int srcHeight, int min, int max, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

min int

Minimum blue value to keep (0-255). Blue values below this become 0.

max int

Maximum blue value to keep (0-255). Blue values above this become 0.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Selectively removes blue channel values outside the [min, max] range, keeping red and green unchanged.

Algorithm: For each pixel, if blue < min OR blue > max, set blue to 0.

Use Cases: Blue screen removal, color key effects, selective color filtering, artistic color manipulation.

Example: FilterBlue(pixels, w, h, 100, 255) removes dark blue tones, keeping only bright blues.

Native Implementation: Calls EffectFilterBlue in VisioForge_MFP.dll

FilterGreen(nint, int, int, int, int, bool)

Filters the green color channel by setting it to 0 if outside specified range, creating selective green channel filtering.

public static void FilterGreen(nint srcPixels, int srcWidth, int srcHeight, int min, int max, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

min int

Minimum green value to keep (0-255). Green values below this become 0.

max int

Maximum green value to keep (0-255). Green values above this become 0.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Selectively removes green channel values outside the [min, max] range, keeping red and blue unchanged.

Algorithm: For each pixel, if green < min OR green > max, set green to 0.

Use Cases: Green screen removal, chroma key effects, vegetation filtering, color-based masking.

Example: FilterGreen(pixels, w, h, 128, 255) removes dark greens, keeping only bright greens.

Native Implementation: Calls EffectFilterGreen in VisioForge_MFP.dll

FilterRed(nint, int, int, int, int, bool)

Filters the red color channel by setting it to 0 if outside specified range, creating selective red channel filtering.

public static void FilterRed(nint srcPixels, int srcWidth, int srcHeight, int min, int max, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

min int

Minimum red value to keep (0-255). Red values below this become 0.

max int

Maximum red value to keep (0-255). Red values above this become 0.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Selectively removes red channel values outside the [min, max] range, keeping green and blue unchanged.

Algorithm: For each pixel, if red < min OR red > max, set red to 0.

Use Cases: Color correction, selective color removal, artistic effects, color-based object isolation.

Example: FilterRed(pixels, w, h, 200, 255) removes dark reds, keeping only bright reds.

Native Implementation: Calls EffectFilterRed in VisioForge_MFP.dll

FlipHorizontalRGB24(nint, int, int)

Flips an RGB24 image horizontally (mirror left-to-right) in-place.

public static void FlipHorizontalRGB24(nint pixels, int width, int height)

Parameters

pixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is flipped in-place.

width int

Width of image in pixels

height int

Height of image in pixels

Remarks

Effect: Mirrors the image along the vertical axis (left side becomes right side and vice versa).

In-Place: Modifies source buffer directly by swapping pixels, no additional memory required.

Use Cases: Mirror/flip camera feed, correct horizontally flipped images, create reflection effects.

Performance: Fast operation using optimized memory swapping.

Native Implementation: Calls FlipHorizontalRGB24 in VisioForge_MFP.dll

FlipHorizontalRGB32(nint, int, int)

Flips an RGB32/ARGB image horizontally (mirror left-to-right) in-place.

public static void FlipHorizontalRGB32(nint pixels, int width, int height)

Parameters

pixels nint

Pointer to image pixel data (RGB32/ARGB format: 4 bytes per pixel, BGRA order). Image is flipped in-place.

width int

Width of image in pixels

height int

Height of image in pixels

Remarks

Effect: Mirrors the image along the vertical axis (left side becomes right side and vice versa).

In-Place: Modifies source buffer directly by swapping pixels, no additional memory required.

Alpha Channel: Preserved during flipping - alpha values follow their pixels.

Use Cases: Mirror camera feed, correct horizontally flipped images, create reflection effects with transparency.

Performance: Fast operation using optimized 32-bit pixel swapping.

Related: See VisioForge.Core.FastImageProcessing.FlipHorizontalRGB24(System.IntPtr,System.Int32,System.Int32) for RGB24 format, VisioForge.Core.FastImageProcessing.FlipVerticalRGB32(System.IntPtr,System.Int32,System.Int32) for vertical flipping.

Native Implementation: Calls FlipHorizontalRGB32 in VisioForge_MFP.dll

FlipVerticalRGB24(nint, int, int)

Flips an RGB24 image vertically (upside-down) in-place.

public static void FlipVerticalRGB24(nint pixels, int width, int height)

Parameters

pixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is flipped in-place.

width int

Width of image in pixels

height int

Height of image in pixels

Remarks

Effect: Mirrors the image along the horizontal axis (top becomes bottom and vice versa).

In-Place: Modifies source buffer by swapping scan lines, no additional memory required.

Use Cases: Correct upside-down images, flip video vertically, convert between top-down and bottom-up bitmap formats.

Common Scenario: Converting between Windows DIB (bottom-up) and standard image formats (top-down).

Native Implementation: Calls FlipVerticalRGB24 in VisioForge_MFP.dll

FlipVerticalRGB32(nint, int, int)

Flips an RGB32/ARGB image vertically (upside-down) in-place.

public static void FlipVerticalRGB32(nint pixels, int width, int height)

Parameters

pixels nint

Pointer to image pixel data (RGB32/ARGB format: 4 bytes per pixel, BGRA order). Image is flipped in-place.

width int

Width of image in pixels

height int

Height of image in pixels

Remarks

Effect: Mirrors the image along the horizontal axis (top becomes bottom and vice versa).

In-Place: Modifies source buffer by swapping scan lines, no additional memory required.

Alpha Channel: Preserved during flipping - alpha values stay with their pixels.

Use Cases: Correct upside-down images, flip video vertically, convert between top-down and bottom-up formats.

Common Scenario: Converting between Windows DIB (bottom-up) and standard ARGB formats (top-down).

Performance: Efficient scan line swapping with 32-bit pixels (4 bytes at a time).

Related: See VisioForge.Core.FastImageProcessing.FlipVerticalRGB24(System.IntPtr,System.Int32,System.Int32) for RGB24 format, VisioForge.Core.FastImageProcessing.FlipHorizontalRGB32(System.IntPtr,System.Int32,System.Int32) for horizontal flipping.

Native Implementation: Calls FlipVerticalRGB32 in VisioForge_MFP.dll

Green(nint, int, int, bool)

Applies a green color filter effect to an RGB24 image, removing red and blue color channels.

public static void Green(nint srcPixels, int srcWidth, int srcHeight, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Keeps only the green channel, sets red and blue to 0, creating a green-tinted monochrome effect.

Pixel Transformation: For each pixel: R=0, G=unchanged, B=0

Visual Result: Similar to night vision or infrared imaging appearance.

Native Implementation: Calls EffectGreen in VisioForge_MFP.dll (C++ VideoEffects.cpp)

Greyscale(nint, int, int, nint)

Converts an RGB24 color image to greyscale using Intel IPP luminance formula.

public static void Greyscale(nint srcPixels, int srcWidth, int srcHeight, nint temp)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

temp nint

Pointer to temporary working buffer. Must be at least width * height bytes (for single-channel greyscale intermediate).

Remarks

Luminance Formula: Uses ITU-R BT.601 standard: Y = 0.299*R + 0.587*G + 0.114*B

Algorithm:

  1. Converts RGB to single-channel greyscale using weighted luminance
  2. Duplicates greyscale value across all three RGB channels (R=G=B=greyscale)
  3. Result is RGB24 image where each pixel has equal R, G, B values

Intel IPP Acceleration: Uses ippiColorToGray_8u_C3C1R and ippiDup_8u_C1C3R for optimized SIMD processing.

Temporary Buffer: Required for intermediate single-channel greyscale data before duplicating to RGB channels.

Native Implementation: Calls EffectGreyscale in VisioForge_MFP.dll (C++ VideoEffects_IPP.cpp: IPPGreyscale function)

ImageCutRGB24(nint, int, int, nint, int, int)

Extracts a sub-region from an RGB24 source image starting at specified coordinates and copies it to output buffer.

public static void ImageCutRGB24(nint srcPixels, int srcWidth, int srcHeight, nint destPixels, int cutX, int cutY)

Parameters

srcPixels nint

Pointer to source image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

srcWidth int

Width of source image in pixels

srcHeight int

Height of source image in pixels

destPixels nint

Pointer to output buffer where extracted region will be written (RGB24 format)

cutX int

X coordinate (column) in source image where extraction starts (0-based)

cutY int

Y coordinate (row) in source image where extraction starts (0-based)

Remarks

Operation: Copies the portion of source image from (cutX, cutY) to (srcWidth-1, srcHeight-1) into output buffer.

Extracted Size: Width = srcWidth - cutX, Height = srcHeight - cutY

Output Buffer Size: Must be at least (srcWidth - cutX) * (srcHeight - cutY) * 3 bytes.

Use Cases: Removing top-left border/margin, extracting bottom-right portion, simple cropping from fixed position.

Difference from Crop: ImageCut extracts from (cutX, cutY) to image end. Crop extracts arbitrary rectangle.

Example: ImageCutRGB24(img, 640, 480, out, 10, 20) extracts 630×460 region starting at (10, 20).

Bounds: cutX must be < srcWidth, cutY must be < srcHeight, otherwise results are undefined.

Related: See VisioForge.Core.FastImageProcessing.Crop24(System.IntPtr,System.UInt32,System.UInt32,System.IntPtr,VisioForge.Core.Types.VFRectIntl) for extracting arbitrary rectangles, VisioForge.Core.FastImageProcessing.ImageCutRGB32(System.IntPtr,System.Int32,System.Int32,System.IntPtr,System.Int32,System.Int32) for RGB32 format.

Native Implementation: Calls ImageCutRGB24 in VisioForge_MFP.dll

ImageCutRGB32(nint, int, int, nint, int, int)

Extracts a sub-region from an RGB32/ARGB source image starting at specified coordinates and copies it to output buffer.

public static void ImageCutRGB32(nint srcPixels, int srcWidth, int srcHeight, nint destPixels, int cutX, int cutY)

Parameters

srcPixels nint

Pointer to source image pixel data (RGB32/ARGB format: 4 bytes per pixel, BGRA order)

srcWidth int

Width of source image in pixels

srcHeight int

Height of source image in pixels

destPixels nint

Pointer to output buffer where extracted region will be written (RGB32/ARGB format)

cutX int

X coordinate (column) in source image where extraction starts (0-based)

cutY int

Y coordinate (row) in source image where extraction starts (0-based)

Remarks

Operation: Copies the portion of source image from (cutX, cutY) to (srcWidth-1, srcHeight-1) into output buffer.

Extracted Size: Width = srcWidth - cutX, Height = srcHeight - cutY

Output Buffer Size: Must be at least (srcWidth - cutX) * (srcHeight - cutY) * 4 bytes.

Alpha Channel: Preserved from source to destination.

Use Cases: Removing margins, extracting portions, simple single-parameter cropping.

Difference from Crop: ImageCut extracts from (cutX, cutY) to image end. Crop32 extracts arbitrary rectangle.

Example: ImageCutRGB32(img, 800, 600, out, 50, 100) extracts 750×500 region starting at (50, 100).

Bounds: cutX must be < srcWidth, cutY must be < srcHeight, otherwise results are undefined.

Related: See VisioForge.Core.FastImageProcessing.Crop32(System.IntPtr,System.UInt32,System.UInt32,System.IntPtr,VisioForge.Core.Types.VFRectIntl) for extracting arbitrary rectangles, VisioForge.Core.FastImageProcessing.ImageCutRGB24(System.IntPtr,System.Int32,System.Int32,System.IntPtr,System.Int32,System.Int32) for RGB24 format.

Native Implementation: Calls ImageCutRGB32 in VisioForge_MFP.dll

Init()

Initializes the Fast Image Processing library by loading the appropriate native DLL (x86 or x64).

public static void Init()

Remarks

This method must be called before using any other methods in this class. It attempts to load and initialize the platform-specific native library:

  • On 32-bit processes: VisioForge_MFP.dll
  • On 64-bit processes: VisioForge_MFP64.dll

If initialization fails, all subsequent operations will fail. Use VisioForge.Core.FastImageProcessing.IsFound to check if initialization was successful.

Invert(nint, int, int, nint)

Inverts all colors in an RGB24 image, creating a photographic negative effect.

public static void Invert(nint srcPixels, int srcWidth, int srcHeight, nint temp)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

temp nint

Pointer to temporary working buffer. Must be at least width * height * 3 bytes.

Remarks

Effect Description: Inverts each color channel by subtracting from 255, creating a negative image effect.

Algorithm: For each pixel: newR = 255 - R, newG = 255 - G, newB = 255 - B

Visual Result: Dark areas become light, light areas become dark; colors become their complements (red↔cyan, green↔magenta, blue↔yellow).

Use Cases: Photographic negative simulation, artistic effects, improving visibility of certain image features.

Property: Applying invert twice returns to original image (it's its own inverse operation).

Native Implementation: Calls EffectInvert in VisioForge_MFP.dll

IsFound()

Checks if the Fast Image Processing library was successfully initialized.

public static bool IsFound()

Returns

bool

true if the native library is loaded and ready to use; otherwise, false.

Remarks

Always check this before using any image processing methods. If this returns false, the native DLL could not be loaded (missing file, wrong architecture, or missing dependencies).

JPEGDataDecodeToRGB(nint, int, nint, int, bool)

Decodes JPEG data from memory buffer into raw RGB pixel data.

public static int JPEGDataDecodeToRGB(nint source, int sourceSize, nint output, int outputSize, bool bgr)

Parameters

source nint

Pointer to JPEG-compressed data in memory

sourceSize int

Size of JPEG data in bytes

output nint

Pointer to output buffer where decoded RGB pixels will be written

outputSize int

Size of output buffer in bytes. Must be at least width * height * 3 for RGB24.

bgr bool

if set to true, outputs BGR byte order (Blue, Green, Red); otherwise RGB byte order (Red, Green, Blue)

Returns

int
  • Positive value: Number of bytes written to output buffer (width * height * 3)
  • 0 or negative: Error occurred during decoding

Remarks

Memory-to-Memory Decoding: Unlike VisioForge.Core.FastImageProcessing.JPEGFileDecodeToRGB(System.String,System.IntPtr,System.Int32,System.Boolean), this decodes from memory buffer instead of file.

Use Cases: Decoding JPEG from network stream, embedded JPEG in file container, JPEG from database, in-memory processing.

Buffer Requirements: Output buffer size depends on decoded image dimensions. Decode header first or allocate large buffer.

Output Format: Always produces 24-bit RGB (3 bytes per pixel) regardless of source JPEG format.

BGR Parameter:

  • True: Outputs BGR order (compatible with Windows DIB, GDI+, DirectShow)
  • False: Outputs RGB order (compatible with OpenGL, standard image formats)

Performance: Uses libjpeg-turbo with SIMD acceleration for fast decoding.

Related: Use VisioForge.Core.FastImageProcessing.JPEGFileDecodeToRGB(System.String,System.IntPtr,System.Int32,System.Boolean) to decode from file, VisioForge.Core.FastImageProcessing.JPEGDataEncodeFromRGB(System.IntPtr,System.Int32,System.Int32,System.Int32,System.Int32,System.IntPtr,System.Int32@,System.Boolean) to encode to memory.

Native Implementation: Calls JPEGDataDecodeToRGB in VisioForge_MFP.dll (libjpeg-turbo wrapper)

JPEGDataEncodeFromRGB(nint, int, int, int, int, nint, out int, bool)

Encodes raw RGB pixel data to JPEG format in memory buffer with specified quality level.

public static int JPEGDataEncodeFromRGB(nint source, int sourceSize, int quality, int width, int height, nint output, out int outputSize, bool bgr)

Parameters

source nint

Pointer to source RGB pixel data buffer

sourceSize int

Size of source buffer in bytes (should be width * height * 3 for RGB24)

quality int

JPEG compression quality (1-100). Higher = better quality, larger output. Typical range: 75-95.

width int

Image width in pixels

height int

Image height in pixels

output nint

Pointer to output buffer where JPEG data will be written. Must be pre-allocated.

outputSize int

Output parameter: Returns actual size of encoded JPEG data in bytes.

bgr bool

if set to true, source is BGR byte order; otherwise RGB byte order

Returns

int
  • 0: Success, JPEG data created in output buffer
  • Non-zero: Error occurred during encoding

Remarks

Memory-to-Memory Encoding: Unlike VisioForge.Core.FastImageProcessing.JPEGFileEncodeFromRGB(System.String,System.Int32,System.IntPtr,System.Int32,System.Int32,System.Int32,System.Boolean), this encodes to memory buffer instead of file.

Use Cases: Encoding for network transmission, storing in databases, embedding in file containers, in-memory processing pipelines.

Output Buffer Size:

  • Worst case: Allocate width * height * 3 bytes (uncompressed size)
  • Typical: 5-20% of uncompressed size depending on quality and content
  • Actual size returned in outputSize parameter after encoding

Quality Parameter:

  • 1-50: High compression, small size, visible artifacts
  • 75-85: Recommended balance of quality and size
  • 90-100: Maximum quality, large size, minimal compression

Performance: Uses libjpeg-turbo with SIMD acceleration. Faster than file I/O version.

Color Space: RGB input is automatically converted to YCbCr (JPEG's native color space).

Related: Use VisioForge.Core.FastImageProcessing.JPEGFileEncodeFromRGB(System.String,System.Int32,System.IntPtr,System.Int32,System.Int32,System.Int32,System.Boolean) to encode to file, VisioForge.Core.FastImageProcessing.JPEGDataDecodeToRGB(System.IntPtr,System.Int32,System.IntPtr,System.Int32,System.Boolean) to decode from memory.

Native Implementation: Calls JPEGDataEncodeFromRGB in VisioForge_MFP.dll (libjpeg-turbo wrapper)

JPEGFileDecodeToRGB(string, nint, int, bool)

Decodes a JPEG file from disk into raw RGB pixel data.

public static int JPEGFileDecodeToRGB(string source, nint output, int outputSize, bool bgr)

Parameters

source string

Full path to JPEG file on disk

output nint

Pointer to output buffer where decoded RGB pixels will be written

outputSize int

Size of output buffer in bytes. Must be at least width * height * 3 for RGB24.

bgr bool

if set to true, outputs BGR byte order (Blue, Green, Red); otherwise RGB byte order (Red, Green, Blue)

Returns

int
  • Positive value: Number of bytes written to output buffer (width * height * 3)
  • 0 or negative: Error occurred during decoding

Remarks

JPEG Decoding: Uses libjpeg-turbo library for fast, hardware-accelerated JPEG decompression.

Output Format: Always produces 24-bit RGB (3 bytes per pixel) regardless of source JPEG format.

BGR Parameter:

  • True: Outputs BGR order (compatible with Windows DIB, GDI+, most video APIs)
  • False: Outputs RGB order (compatible with OpenGL, some image libraries)

Buffer Size: Caller must allocate output buffer. To determine size, use image dimensions: width * height * 3 bytes.

Performance: Uses SIMD acceleration (SSE2/AVX2) when available for fast decoding.

Supported Formats: Standard JPEG/JFIF, progressive JPEG, grayscale JPEG.

Native Implementation: Calls JPEGFileDecodeToRGB in VisioForge_MFP.dll (libjpeg-turbo wrapper)

JPEGFileEncodeFromRGB(string, int, nint, int, int, int, bool)

Encodes raw RGB pixel data to a JPEG file on disk with specified quality level.

public static int JPEGFileEncodeFromRGB(string filename, int quality, nint source, int sourceSize, int width, int height, bool bgr)

Parameters

filename string

Full path where JPEG file will be saved (Unicode/wide character path)

quality int

JPEG compression quality (1-100). Higher = better quality, larger file. Typical range: 75-95.

source nint

Pointer to source RGB pixel data buffer

sourceSize int

Size of source buffer in bytes (should be width * height * 3 for RGB24)

width int

Image width in pixels

height int

Image height in pixels

bgr bool

if set to true, source is BGR byte order; otherwise RGB byte order

Returns

int
  • 0: Success, JPEG file created
  • Non-zero: Error occurred during encoding or file writing

Remarks

JPEG Encoding: Uses libjpeg-turbo library for fast, hardware-accelerated JPEG compression.

Quality Parameter:

  • 1-50: Low quality, high compression, small file (not recommended)
  • 50-75: Medium quality, good compression (acceptable for thumbnails)
  • 75-90: High quality, moderate compression (recommended for most uses)
  • 90-100: Maximum quality, minimal compression, large file (archival quality)

File Format: Creates standard JFIF JPEG files compatible with all image viewers and editors.

Color Space: RGB input is converted to YCbCr (JPEG's native color space) during encoding.

Performance: Uses SIMD acceleration for fast encoding. Encoding speed depends on quality setting.

File Overwrite: Overwrites existing file without warning if filename already exists.

Native Implementation: Calls JPEGFileEncodeFromRGB in VisioForge_MFP.dll (libjpeg-turbo wrapper)

Marble(nint, int, int, double, int)

Applies a marble texture effect to an RGB24 image using Perlin noise and turbulence.

public static void Marble(nint srcPixels, int width, int height, double scale, int turbulence)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

scale double

Scale factor for marble pattern (0.1-10.0). Larger values create larger, smoother marble veins.

turbulence int

Turbulence amount (0-100). Higher values create more chaotic, detailed marble patterns.

Remarks

Effect Description: Generates organic marble-like veining patterns using Perlin noise combined with the original image colors.

Algorithm: Uses multi-octave Perlin noise with turbulence to create swirling patterns that blend with source colors.

Scale Parameter:

  • 0.1-1.0: Fine, detailed marble veins
  • 1.0-5.0: Medium-scale marble patterns (realistic)
  • 5.0-10.0: Large, sweeping marble features

Turbulence Parameter:

  • 0-30: Smooth, gentle marble flows
  • 30-70: Moderate turbulence, realistic marble
  • 70-100: High turbulence, chaotic artistic patterns

Use Cases: Artistic effects, texture generation, background patterns, simulating natural stone materials.

Native Implementation: Calls EffectMarble in VisioForge_MFP.dll

MirrorDown(nint, int, int, nint)

Mirrors the bottom half of an RGB24 image onto the top half, creating a symmetrical effect using Intel IPP.

public static void MirrorDown(nint srcPixels, int width, int height, nint tempData)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

tempData nint

Pointer to temporary working buffer. Must be at least (width * height * 3) / 2 bytes (half image size).

Remarks

Effect Description: Takes the bottom half of the image, flips it vertically, and replaces the top half with this mirrored copy.

Algorithm:

  1. Mirrors entire image vertically (flips upside down using Intel IPP)
  2. Copies top half to temporary buffer
  3. Mirrors the copied top half vertically again
  4. Replaces bottom half with the processed data

Visual Result: Creates a perfectly symmetrical image with a horizontal mirror axis in the center.

Symmetry Axis: The middle horizontal line becomes the axis of symmetry.

Use Cases: Artistic symmetry effects, kaleidoscope-like patterns, creating mirrored compositions, reflection effects.

Related: See VisioForge.Core.FastImageProcessing.MirrorRight(System.IntPtr,System.Int32,System.Int32) for vertical axis mirroring (left/right instead of top/bottom).

Temporary Buffer: Required for intermediate storage during mirroring operation (half the image size).

Performance: Uses Intel IPP ippiMirror_8u_C3IR for optimized SIMD mirroring.

Native Implementation: Calls EffectMirrorDownEx in VisioForge_MFP.dll (C++ VideoEffects_IPP.cpp: IPPMirrorDown function)

MirrorRight(nint, int, int)

Mirrors the right half of an RGB24 image onto the left half, creating a symmetrical effect.

public static void MirrorRight(nint srcPixels, int width, int height)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

Remarks

Effect Description: Takes the right half of the image, flips it horizontally, and replaces the left half with this mirrored copy.

Algorithm: For each row, copies pixels from right half to left half in reverse order, creating vertical axis symmetry.

Visual Result: Creates a perfectly symmetrical image with a vertical mirror axis in the center.

Use Cases: Artistic symmetry effects, kaleidoscope-like patterns, creating mirrored compositions.

Related: See VisioForge.Core.FastImageProcessing.MirrorDown(System.IntPtr,System.Int32,System.Int32,System.IntPtr) for horizontal axis mirroring (top/bottom instead of left/right).

Native Implementation: Calls EffectMirrorRight in VisioForge_MFP.dll

MonoNoise(nint, int, int, int, bool)

Adds random monochrome (grayscale) noise to an RGB24 image, creating a film grain effect.

public static void MonoNoise(nint srcPixels, int srcWidth, int srcHeight, int amount, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

amount int

Intensity of noise effect (0-255). Higher values = more visible noise.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Adds the same random value to all three RGB channels of each pixel, creating grayscale speckles.

Difference from ColorNoise: MonoNoise adds identical noise to R, G, and B, producing grayscale grain. ColorNoise adds different noise to each channel, producing colored speckles.

Amount Parameter: Controls the maximum random deviation (0 = no effect, 255 = maximum noise).

Use Cases: Film grain simulation, analog photography effects, vintage video look, noise addition for testing denoisers.

Visual Result: Similar to photographic film grain or old TV static in grayscale.

Native Implementation: Calls EffectMonoNoise in VisioForge_MFP.dll

Mosaic(nint, int, int, int)

Applies a mosaic (pixelation) effect to an RGB24 image by averaging color blocks.

public static void Mosaic(nint srcPixels, int width, int height, int size)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

size int

Size of mosaic blocks in pixels (1-100). Larger values create bigger blocks and stronger pixelation.

Remarks

Effect Description: Divides image into square blocks and sets all pixels in each block to the average color of that block.

Algorithm: For each size×size block, calculates average RGB values and fills the entire block with this average color.

Size Parameter:

  • 1-5: Subtle pixelation, retains most detail
  • 5-15: Moderate mosaic effect, visible blocks
  • 15-50: Strong pixelation, abstract appearance
  • 50+: Extreme pixelation, very blocky

Use Cases: Privacy protection (face/license plate obscuring), artistic effects, retro 8-bit game look, censorship.

ROI Version: Use VisioForge.Core.FastImageProcessing.MosaicROI(System.IntPtr,System.Int32,System.Int32,System.Int32,VisioForge.Core.Types.VFRectIntl) to apply mosaic to specific rectangular region only.

Native Implementation: Calls EffectMosaic in VisioForge_MFP.dll

MosaicROI(nint, int, int, int, VFRectIntl)

Applies a mosaic (pixelation) effect to a specific rectangular region of an RGB24 image.

public static void MosaicROI(nint srcPixels, int width, int height, int size, VFRectIntl rect)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of entire image in pixels

height int

Height of entire image in pixels

size int

Size of mosaic blocks in pixels (1-100). Larger values create bigger blocks.

rect VFRectIntl

Rectangle defining the region to apply mosaic effect (ROI - Region Of Interest)

Remarks

Effect Description: Same as VisioForge.Core.FastImageProcessing.Mosaic(System.IntPtr,System.Int32,System.Int32,System.Int32) but only affects pixels within the specified rectangle, leaving rest of image unchanged.

Use Cases: Selective privacy protection (blur specific faces/areas), partial censorship, targeted artistic effects.

ROI Rectangle: Defines area as (Left, Top, Right, Bottom) or (X, Y, Width, Height) depending on VFRectIntl structure.

Clipping: If rectangle extends beyond image boundaries, it's automatically clipped to image size.

Performance: Faster than full-image mosaic when only small region needs processing.

Native Implementation: Calls EffectMosaicROI in VisioForge_MFP.dll

MotionDetectionBuildMatrix(int, int, int, int, byte[], nint)

Motion detection, build matrix.

public static void MotionDetectionBuildMatrix(int width, int height, int linesX, int linesY, byte[] matrixRes, nint matrix)

Parameters

width int

The width.

height int

The height.

linesX int

The lines x.

linesY int

The lines y.

matrixRes byte[]

The matrix resource.

matrix nint

The matrix.

MotionDetectionCompareImages(nint, nint, nint, bool, bool, bool, bool, int)

Motion detection, compare images.

public static int MotionDetectionCompareImages(nint pic1, nint pic2, nint matrix, bool compareGreyscale, bool compareRed, bool compareGreen, bool compareBlue, int numPixels)

Parameters

pic1 nint

The pic 1.

pic2 nint

The pic 2.

matrix nint

The matrix.

compareGreyscale bool

if set to true compare greyscale.

compareRed bool

if set to true compare red.

compareGreen bool

if set to true compare green.

compareBlue bool

if set to true compare blue.

numPixels int

The number data.

Returns

int

System.Int32.

MotionDetectionHighlight(nint, nint, int, int, int)

Motion detection, highlight.

public static void MotionDetectionHighlight(nint frame, nint matrix, int numPixels, int color, int chlThreshold)

Parameters

frame nint

The frame.

matrix nint

The matrix.

numPixels int

The number data.

color int

The color.

chlThreshold int

The CHL threshold.

PanCreate(ref RAWImage, VideoInterpolationMode)

Creates a reusable pan context for efficient repeated pan/crop operations with smooth interpolation.

public static nint PanCreate(ref RAWImage image, VideoInterpolationMode interpolationMode)

Parameters

image RAWImage

RAWImage structure describing the image format, dimensions, and stride

interpolationMode VideoInterpolationMode

Interpolation algorithm to use when scaling during pan (nearest, linear, cubic)

Returns

nint

IntPtr handle to pan context. Must be destroyed with VisioForge.Core.FastImageProcessing.PanDestroy(System.IntPtr) when done.

Remarks

Purpose: Creating a pan context enables smooth animated panning and cropping with Ken Burns-style effects.

Pan vs Zoom:

  • Pan: Extracts and scales a rectangular region from source image
  • Zoom: Magnifies/shrinks entire image with optional offset
  • Pan is better for animated region-of-interest extraction

Usage Pattern:

  1. Call PanCreate once with image specifications
  2. Call VisioForge.Core.FastImageProcessing.PanImage(System.IntPtr,VisioForge.Core.Types.RAWImage@,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int64,System.Int64,System.Int64) multiple times with animated start/stop positions and times
  3. Call VisioForge.Core.FastImageProcessing.PanDestroy(System.IntPtr) to free resources when done

Use Cases: Ken Burns effect on still photos, animated slideshows, smooth ROI transitions, cinematic panning.

Native Implementation: Calls PanCreate in VisioForge_MFP.dll

PanDestroy(nint)

Destroys a pan context created by VisioForge.Core.FastImageProcessing.PanCreate(VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.VideoInterpolationMode) and frees all associated resources.

public static void PanDestroy(nint pan)

Parameters

pan nint

IntPtr handle to pan context returned by PanCreate

Remarks

Resource Management: Always call this when done using a pan context to prevent memory leaks.

Safe to Call: Can safely be called with IntPtr.Zero (will be ignored).

After Calling: The pan handle becomes invalid and must not be used in subsequent operations.

Native Implementation: Calls PanDestroy in VisioForge_MFP.dll

PanImage(nint, ref RAWImage, int, int, int, int, int, int, int, int, long, long, long)

Pan effect, process.

public static int PanImage(nint pan, ref RAWImage image, int startX, int startY, int startWidth, int startHeight, int stopX, int stopY, int stopWidth, int stopHeight, long startTime, long stopTime, long currentTime)

Parameters

pan nint

The pan.

image RAWImage

The image.

startX int

The start x.

startY int

The start y.

startWidth int

The start width.

startHeight int

The start height.

stopX int

The stop x.

stopY int

The stop y.

stopWidth int

Width of the stop.

stopHeight int

Height of the stop.

startTime long

The start time.

stopTime long

The stop time.

currentTime long

The current time.

Returns

int

System.Int32.

Posterize(nint, int, int, int)

Applies a posterization effect to an RGB24 image by reducing the number of color levels per channel.

public static void Posterize(nint srcPixels, int width, int height, int amount)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

amount int

Number of color levels per channel (2-128). Lower values create more dramatic posterization.

Remarks

Effect Description: Reduces color bit depth by grouping similar colors into discrete levels, creating a poster-like appearance with flat color areas.

Algorithm: Divides the 0-255 range into 'amount' equal steps, rounds each color value to nearest step, reducing total colors to amount³.

Amount Parameter:

  • 2-4: Extreme posterization, very few colors (8-64 total), high contrast
  • 4-8: Strong posterization, pop art style (64-512 colors)
  • 8-16: Moderate posterization, retro digital look (512-4096 colors)
  • 16-32: Subtle posterization, slight banding visible (4096-32768 colors)
  • 32+: Very subtle, approaching original image quality

Total Colors: With amount=N, total possible colors = N × N × N (N³)

Use Cases: Pop art effects, retro computing aesthetics, reducing file size for indexed color formats, artistic simplification.

Native Implementation: Calls EffectPosterize in VisioForge_MFP.dll

Red(nint, int, int, bool)

Applies a red color filter effect to an RGB24 image, removing green and blue color channels.

public static void Red(nint srcPixels, int srcWidth, int srcHeight, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Keeps only the red channel, sets green and blue to 0, creating a red-tinted monochrome effect.

Pixel Transformation: For each pixel: R=unchanged, G=0, B=0

Visual Result: Creates a dramatic red-only image, commonly used for artistic effects or infrared simulation.

Native Implementation: Calls EffectRed in VisioForge_MFP.dll (C++ VideoEffects.cpp)

ResizeCreate(ref RAWImage, ref RAWImage, VideoResizeMode, bool)

Creates a reusable resize context for efficient repeated resizing operations using Intel IPP.

public static nint ResizeCreate(ref RAWImage srcData, ref RAWImage dstData, VideoResizeMode interpolation, bool antialiasing)

Parameters

srcData RAWImage

Source image specification (width, height, format, stride)

dstData RAWImage

Destination image specification (target width, height, format, stride)

interpolation VideoResizeMode

Interpolation algorithm to use for resizing quality

antialiasing bool

if set to true, applies antialiasing filter during downscaling to prevent aliasing artifacts

Returns

nint

IntPtr handle to resize context. Must be destroyed with VisioForge.Core.FastImageProcessing.ResizeDestroy(System.IntPtr) when done.

Remarks

Purpose: Creating a resize context allows Intel IPP to pre-calculate interpolation coefficients,

making subsequent resize operations on same-size images much faster (e.g., video frame processing).

Interpolation Modes:

  • Nearest Neighbor: Fastest, lowest quality, good for pixel art
  • Linear/Bilinear: Fast, medium quality, good for real-time video
  • Cubic/Bicubic: Slower, high quality, good for still images
  • Lanczos: Slowest, highest quality, best for archival/professional work

Antialiasing:

  • True: Applies low-pass filter before downscaling to prevent Moiré patterns and aliasing
  • False: Skip filtering for faster processing (may show aliasing when downscaling)
  • Recommended: Enable for downscaling (e.g., 1920x1080 → 640x480), disable for upscaling

Usage Pattern:

  1. Call ResizeCreate once with source and destination specifications
  2. Call VisioForge.Core.FastImageProcessing.ResizeRAWImage(System.IntPtr,VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.RAWImage@) multiple times with same-size images
  3. Call VisioForge.Core.FastImageProcessing.ResizeDestroy(System.IntPtr) to free resources when done

Performance: Significantly faster than VisioForge.Core.FastImageProcessing.ResizeSimple(VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.VideoResizeMode) for repeated operations on same dimensions.

Native Implementation: Calls ResizeCreate in VisioForge_MFP.dll (Intel IPP resize initialization)

ResizeDestroy(nint)

Destroys a resize context created by VisioForge.Core.FastImageProcessing.ResizeCreate(VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.VideoResizeMode,System.Boolean) and frees all associated resources.

public static void ResizeDestroy(nint resize)

Parameters

resize nint

IntPtr handle to resize context returned by ResizeCreate

Remarks

Resource Management: Always call this when done using a resize context to prevent memory leaks.

Safe to Call: Can safely be called with IntPtr.Zero (will be ignored).

After Calling: The resize handle becomes invalid and must not be used in subsequent operations.

Native Implementation: Calls ResizeDestroy in VisioForge_MFP.dll (frees Intel IPP resize context)

ResizeRAWImage(nint, ref RAWImage, ref RAWImage)

Resizes the RAW image.

public static int ResizeRAWImage(nint resize, ref RAWImage srcData, ref RAWImage dstData)

Parameters

resize nint

The resize.

srcData RAWImage

The source data.

dstData RAWImage

The destination data.

Returns

int

System.Int32.

ResizeSimple(ref RAWImage, ref RAWImage, VideoResizeMode)

Resize.

public static int ResizeSimple(ref RAWImage srcData, ref RAWImage dstData, VideoResizeMode videoResizeMode)

Parameters

srcData RAWImage

The source data.

dstData RAWImage

The destination data.

videoResizeMode VideoResizeMode

The video resize mode.

Returns

int

System.Int32.

RotateIn(nint, int, int, nint, double, bool, nint, ref int)

Rotates an RGB24 image by arbitrary angle using Intel IPP with optional stretching to fit rotated content.

public static void RotateIn(nint srcPixels, int width, int height, nint tempPixels, double angle, bool stretch, nint workingBuffer, ref int workingBufferSize)

Parameters

srcPixels nint

Pointer to source image pixel data (RGB24 format: 3 bytes per pixel, BGR order)

width int

Width of image in pixels

height int

Height of image in pixels

tempPixels nint

Pointer to temporary output buffer. Must be same size or larger than source (width * height * 3 bytes minimum)

angle double

Rotation angle in degrees (positive = counter-clockwise, negative = clockwise)

stretch bool

if set to true, stretches rotated result to fill original dimensions; otherwise, may crop or leave black borders

workingBuffer nint

Pointer to working memory buffer for rotation algorithm (can be IntPtr.Zero on first call)

workingBufferSize int

Input/Output: Size of working buffer in bytes. On first call with null buffer, returns required size.

Remarks

Rotation Algorithm: Uses Intel IPP's high-quality rotation with interpolation to avoid aliasing artifacts.

Working Buffer Pattern:

  1. First call: Pass IntPtr.Zero for workingBuffer, method returns required size in workingBufferSize
  2. Allocate buffer of returned size
  3. Subsequent calls: Pass allocated buffer pointer and size

Angle Parameter:

  • 0°: No rotation
  • 90°: Rotate 90° counter-clockwise (portrait to landscape)
  • -90° or 270°: Rotate 90° clockwise
  • 180°: Flip upside down
  • Any value: Arbitrary rotation with interpolation

Stretch Parameter:

  • True: Scales rotated result to fit original dimensions (may distort aspect ratio)
  • False: Maintains aspect ratio, may show black areas where rotated content doesn't fill frame

Legacy Method: For rotation without cropping, use VisioForge.Core.FastImageProcessing.RotateInNoCrop(System.IntPtr,System.Int32,System.Int32,System.Double,System.Int32) which is newer and simpler.

Native Implementation: Calls RotateIn in VisioForge_MFP.dll (uses Intel IPP ippiRotate functions)

RotateInNoCrop(nint, int, int, double, int)

Rotates an RGB24 image by arbitrary angle in-place without cropping, keeping full rotated frame content using Intel IPP.

public static void RotateInNoCrop(nint srcPixels, int width, int height, double angle, int stride = 0)

Parameters

srcPixels nint

Pointer to RGB24 pixel buffer (3 bytes per pixel, BGR order). Image is rotated in-place.

width int

Frame width in pixels

height int

Frame height in pixels

angle double

Rotation angle in degrees (positive = counter-clockwise, negative = clockwise). Any value supported.

stride int

Number of bytes per row. Pass 0 to auto-compute as width * 3 for RGB24.

Remarks

No-Crop Rotation: Unlike VisioForge.Core.FastImageProcessing.RotateIn(System.IntPtr,System.Int32,System.Int32,System.IntPtr,System.Double,System.Boolean,System.IntPtr,System.Int32@), this method preserves the entire rotated content without cropping or black borders.

In-Place Operation: Modifies the source buffer directly. Ensure buffer is large enough for rotated dimensions.

Stride Parameter:

  • 0 (recommended): Auto-calculates as width * 3 for RGB24
  • Custom value: Use when image has padding/alignment (e.g., aligned to 4-byte boundaries)

Quality: Uses Intel IPP's high-quality interpolation (bicubic or bilinear) for smooth rotation without stair-stepping.

Common Angles:

  • 90, -90, 180: Fast optimized paths for orthogonal rotations
  • Other angles: Uses high-quality interpolation

Error Handling: Throws detailed exceptions with native error messages if rotation fails.

Native Implementation: Calls IPPRotateNoCrop in VisioForge_MFP.dll (custom Intel IPP wrapper)

Exceptions

ArgumentNullException

Thrown if srcPixels is IntPtr.Zero

ArgumentOutOfRangeException

Thrown if width or height is less than or equal to 0

InvalidOperationException

Thrown if rotation fails, native library not found, or architecture mismatch

Saturation(nint, int, int, int, bool)

Adjusts color saturation of an RGB24 image by increasing or decreasing color intensity while preserving luminance.

public static void Saturation(nint srcPixels, int srcWidth, int srcHeight, int amount, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

amount int

Saturation adjustment amount (-255 to +255). Positive = more vivid colors, negative = less vivid (toward grayscale), 0 = no change.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Adjusts the intensity of colors without changing brightness. Increases/decreases the difference between color channels.

Algorithm: Converts RGB to HSL (Hue, Saturation, Lightness), adjusts S component, converts back to RGB.

Amount Parameter:

  • -255: Complete desaturation (grayscale image)
  • -128 to -50: Significant desaturation (washed out, pastel)
  • -50 to 0: Subtle desaturation (muted colors)
  • 0: No change
  • 0 to +50: Subtle increase (more vivid)
  • +50 to +128: Strong increase (highly saturated, vibrant)
  • +128 to +255: Extreme saturation (may clip colors, neon-like)

Preservation: Unlike simple color scaling, this maintains perceptual brightness and hue while only changing color intensity.

Use Cases: Color correction, artistic enhancement, creating vintage desaturated look, making colors pop for video.

Native Implementation: Calls EffectSaturation in VisioForge_MFP.dll

ShakeDown(nint, int, int, int)

Applies a vertical shake/distortion effect to an RGB24 image by randomly shifting scan lines vertically.

public static void ShakeDown(nint srcPixels, int width, int height, int factor)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

factor int

Shake intensity (1-50). Higher values create more vertical displacement.

Remarks

Effect Description: Randomly shifts horizontal scan lines up or down, creating a distorted/glitch appearance.

Algorithm: For each scan line, randomly shifts it vertically by amount determined by factor, wrapping around at image boundaries.

Factor Parameter:

  • 1-10: Subtle shake, slight vertical distortion
  • 10-25: Moderate shake, visible glitch effect
  • 25-50: Strong shake, heavy distortion/scrambling

Use Cases: VHS glitch effects, digital artifact simulation, creative distortion, motion blur simulation.

Visual Result: Similar to analog video interference or vertical hold problems on old TVs.

Native Implementation: Calls EffectShakeDown in VisioForge_MFP.dll

Sharpen(nint, int, int, nint)

Applies a sharpening filter to an RGB24 image to enhance edges and fine details.

public static void Sharpen(nint srcPixels, int width, int height, nint temp)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

temp nint

Pointer to temporary working buffer. Must be at least width * height * 3 bytes.

Remarks

Effect Description: Enhances edges and details by accentuating differences between adjacent pixels using a sharpening kernel.

Algorithm: Uses a convolution kernel that amplifies high-frequency components (edges) while preserving low-frequency (smooth areas).

Typical Kernel: Center weight is positive and large, surrounding pixels are negative, creating edge enhancement.

Use Cases: Improving perceived sharpness of blurry images, enhancing text readability, compensating for soft camera focus.

Side Effects: May amplify noise and compression artifacts along with edges.

Temporary Buffer: Required for intermediate convolution results before writing back to source.

Native Implementation: Calls EffectSharpen in VisioForge_MFP.dll

Solorize(nint, int, int, int, bool)

Applies a solarization effect to an RGB24 image by inverting colors above a threshold, creating a photographic solarization look.

public static void Solorize(nint srcPixels, int srcWidth, int srcHeight, int amount, bool smartMultithreading = true)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

srcWidth int

Width of image in pixels

srcHeight int

Height of image in pixels

amount int

Solarization threshold (0-255). Values above this threshold are inverted.

smartMultithreading bool

if set to true, uses parallel processing for images > 200x200 pixels

Remarks

Effect Description: Inverts color values that exceed the threshold, creating a partial negative effect similar to photographic solarization.

Algorithm: For each color channel: if value > amount, then newValue = 255 - value; else newValue = value

Amount Parameter (Threshold):

  • 0-64: Inverts most colors, strong solarization (mostly negative)
  • 64-128: Balanced solarization, mix of normal and inverted
  • 128-192: Moderate solarization, inverts only bright areas
  • 192-255: Subtle solarization, inverts only very bright highlights

Photographic Origin: Named after a darkroom technique where film is briefly exposed to light during development.

Visual Result: Creates surreal metallic tones with inverted highlights, popular in psychedelic and experimental photography.

Use Cases: Artistic effects, retro photography look, experimental imaging, unique color palettes.

Native Implementation: Calls EffectSolorize in VisioForge_MFP.dll

Spray(nint, int, int, int)

Applies a spray paint effect to an RGB24 image by randomly dispersing pixels within local neighborhoods.

public static void Spray(nint srcPixels, int width, int height, int amount)

Parameters

srcPixels nint

Pointer to image pixel data (RGB24 format: 3 bytes per pixel, BGR order). Image is modified in-place.

width int

Width of image in pixels

height int

Height of image in pixels

amount int

Spray radius (1-50). Larger values create more dispersed, scattered appearance.

Remarks

Effect Description: Randomly replaces each pixel with a pixel from its neighborhood, creating a diffused spray paint appearance.

Algorithm: For each pixel, randomly selects another pixel within a radius of 'amount' pixels and copies its color.

Amount Parameter (Spray Radius):

  • 1-5: Subtle spray effect, slight pixel dispersion
  • 5-15: Moderate spray, visible spray paint look
  • 15-30: Strong spray, heavily diffused artistic effect
  • 30-50: Extreme spray, very abstract scattered appearance

Visual Result: Simulates the stippled texture of spray paint or airbrush, with colors bleeding and mixing at edges.

Use Cases: Artistic effects, simulating spray paint or watercolor, creating impressionistic looks, graffiti-style rendering.

Randomness: Effect is non-deterministic - running twice produces different results.

Native Implementation: Calls EffectSpray in VisioForge_MFP.dll

ZoomCreate(ref RAWImage, VideoInterpolationMode)

Creates a reusable zoom context for efficient repeated zoom operations on images.

public static nint ZoomCreate(ref RAWImage image, VideoInterpolationMode interpolationMode)

Parameters

image RAWImage

RAWImage structure describing the image format, dimensions, and stride

interpolationMode VideoInterpolationMode

Interpolation algorithm to use for zooming quality (nearest, linear, cubic)

Returns

nint

IntPtr handle to zoom context. Must be destroyed with VisioForge.Core.FastImageProcessing.ZoomDestroy(System.IntPtr) when done.

Remarks

Purpose: Creating a zoom context allows pre-calculating interpolation data for efficient repeated zoom operations.

Interpolation Modes:

  • Nearest Neighbor: Fastest, blocky appearance when zooming in, good for pixel art
  • Linear/Bilinear: Fast, smooth zoom, good for real-time video
  • Cubic/Bicubic: Slower, highest quality, best for still images and detailed content

Usage Pattern:

  1. Call ZoomCreate once with image specifications
  2. Call VisioForge.Core.FastImageProcessing.ZoomImage(System.IntPtr,VisioForge.Core.Types.RAWImage@,System.Double,System.Double,System.Int32,System.Int32) multiple times with different zoom levels and shifts
  3. Call VisioForge.Core.FastImageProcessing.ZoomDestroy(System.IntPtr) to free resources when done

Performance: Reusing context is much faster than creating new context for each zoom operation.

Related: See VisioForge.Core.FastImageProcessing.PanCreate(VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.VideoInterpolationMode) for pan-only operations, VisioForge.Core.FastImageProcessing.ResizeCreate(VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.VideoResizeMode,System.Boolean) for pure resizing.

Native Implementation: Calls ZoomCreate in VisioForge_MFP.dll

ZoomDestroy(nint)

Destroys a zoom context created by VisioForge.Core.FastImageProcessing.ZoomCreate(VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.VideoInterpolationMode) and frees all associated resources.

public static void ZoomDestroy(nint zoom)

Parameters

zoom nint

IntPtr handle to zoom context returned by ZoomCreate

Remarks

Resource Management: Always call this when done using a zoom context to prevent memory leaks.

Safe to Call: Can safely be called with IntPtr.Zero (will be ignored).

After Calling: The zoom handle becomes invalid and must not be used in subsequent operations.

Native Implementation: Calls ZoomDestroy in VisioForge_MFP.dll

ZoomImage(nint, ref RAWImage, double, double, int, int)

Applies zoom and pan transformations to an image using a pre-created zoom context.

public static int ZoomImage(nint zoom, ref RAWImage image, double zoomX, double zoomY, int shiftX, int shiftY)

Parameters

zoom nint

IntPtr handle to zoom context created by VisioForge.Core.FastImageProcessing.ZoomCreate(VisioForge.Core.Types.RAWImage@,VisioForge.Core.Types.VideoInterpolationMode)

image RAWImage

RAWImage structure containing source image data and receiving zoomed result (in-place operation)

zoomX double

Horizontal zoom factor (1.0 = no zoom, >1.0 = zoom in/magnify, <1.0 = zoom out/shrink)

zoomY double

Vertical zoom factor (1.0 = no zoom, >1.0 = zoom in/magnify, <1.0 = zoom out/shrink)

shiftX int

Horizontal pan offset in pixels (positive = shift right, negative = shift left). Applied after zoom.

shiftY int

Vertical pan offset in pixels (positive = shift down, negative = shift up). Applied after zoom.

Returns

int

0 on success, non-zero on error

Remarks

Zoom + Pan Operation: Applies both zooming and panning in a single optimized operation.

Zoom Factors:

  • 1.0: Original size (100%, no zoom)
  • 2.0: 2x magnification (zoom in, image appears 2x larger)
  • 0.5: 0.5x reduction (zoom out, image appears 2x smaller)
  • Different X and Y values: Non-uniform scaling (aspect ratio change)

Pan Offsets:

  • Applied after zoom transformation
  • Allow viewing different portions of zoomed image
  • Useful for digital pan-tilt-zoom (PTZ) camera simulation

Use Cases:

  • Digital zoom for cameras without optical zoom
  • PTZ simulation (pan-tilt-zoom without mechanical movement)
  • Focus on specific image regions
  • Ken Burns effect (slow zoom/pan over still images)
  • Video stabilization preview

Performance: Efficient when using pre-created zoom context with same image size. Uses interpolation mode specified in ZoomCreate.

Clipping: Areas outside the source image after zoom/pan will show black or undefined data.

Native Implementation: Calls ZoomImage in VisioForge_MFP.dll