Table of Contents

Class PixelFormatHelper

Namespace
VAST.Common
Assembly
VAST.Common.dll

Provides helper methods for working with pixel formats.

public static class PixelFormatHelper
Inheritance
PixelFormatHelper
Inherited Members

Methods

CreateColorBuffer(MediaType, string)

Creates a VersatileBuffer filled with the specified color for the given media type.

public static VersatileBuffer CreateColorBuffer(MediaType mt, string scolor)

Parameters

mt MediaType

The media type describing the video format.

scolor string

The color in string format (e.g., "#AARRGGBB").

Returns

VersatileBuffer

A VersatileBuffer filled with the color, or null if the format is unsupported.

GetPlaneCount(PixelFormat)

Gets the number of planes in the specified pixel format.

public static int GetPlaneCount(PixelFormat pixelFormat)

Parameters

pixelFormat PixelFormat

The pixel format.

Returns

int

The number of planes, or 0 if unknown.

GetPlaneHeight(int, PixelFormat, int)

Gets the height of a specific plane for the specified pixel format.

public static int GetPlaneHeight(int height, PixelFormat pixelFormat, int planeIndex)

Parameters

height int

The height of the image in pixels.

pixelFormat PixelFormat

The pixel format.

planeIndex int

The zero-based plane index.

Returns

int

The plane height in rows, or 0 if unknown.

GetPlaneStride(int, PixelFormat, int)

Gets the stride (bytes per row) for a specific plane of the specified pixel format.

public static int GetPlaneStride(int width, PixelFormat pixelFormat, int planeIndex)

Parameters

width int

The width of the image in pixels.

pixelFormat PixelFormat

The pixel format.

planeIndex int

The zero-based plane index.

Returns

int

The stride in bytes, or 0 if unknown.

GetStorageBitsPerPixel(PixelFormat)

Gets the number of bits per pixel required to store the specified pixel format.

public static int GetStorageBitsPerPixel(PixelFormat pixelFormat)

Parameters

pixelFormat PixelFormat

The pixel format.

Returns

int

The number of bits per pixel, or 0 if unknown.