Show / Hide Table of Contents

Struct ImageInfo

Represents image metadata including width, height, pixel format, and memory alignment.

Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: FFmpeg.Images
Assembly: FFmpeg.dll
Syntax
public readonly struct ImageInfo

Constructors

View Source

ImageInfo(int, int, PixelFormat)

Initializes a new instance of the ImageInfo struct with the specified width, height, and pixel format. Default alignment is set to 1.

Declaration
public ImageInfo(int width, int height, PixelFormat format)
Parameters
Type Name Description
int width

The width of the image in pixels.

int height

The height of the image in pixels.

PixelFormat format

The pixel format of the image.

View Source

ImageInfo(int, int, PixelFormat, int)

Represents image metadata including width, height, pixel format, and memory alignment.

Declaration
public ImageInfo(int width, int height, PixelFormat format, int alignment)
Parameters
Type Name Description
int width
int height
PixelFormat format
int alignment

Properties

View Source

Alignment

Gets the alignment of the image buffer in memory. Alignment affects the memory padding used to ensure proper alignment for optimized access.

Declaration
public int Alignment { get; init; }
Property Value
Type Description
int
View Source

BufferSize

Gets the total buffer size required for storing the image in bytes, considering width, height, format, and alignment.

Declaration
public int BufferSize { get; }
Property Value
Type Description
int
View Source

Format

Gets the pixel format of the image.

Declaration
public PixelFormat Format { get; init; }
Property Value
Type Description
PixelFormat
View Source

Height

Gets the height of the image in pixels.

Declaration
public int Height { get; init; }
Property Value
Type Description
int
View Source

Planes

Gets the number of planes in the image based on the pixel format. Different pixel formats may split the image data into multiple planes.

Declaration
public int Planes { get; }
Property Value
Type Description
int
View Source

Width

Gets the width of the image in pixels.

Declaration
public int Width { get; init; }
Property Value
Type Description
int

Methods

View Source

GetLineSize(int)

Gets the size of each line (stride) in bytes for the specified plane. The line size represents the width of the image data for a single row in that plane.

Declaration
public int GetLineSize(int plane)
Parameters
Type Name Description
int plane

The index of the plane for which to retrieve the line size.

Returns
Type Description
int

The line size in bytes for the specified plane.

View Source

WithAlignment(int)

Creates a new ImageInfo with a modified memory alignment while keeping other properties unchanged.

Declaration
public ImageInfo WithAlignment(int align)
Parameters
Type Name Description
int align

The new memory alignment for the image.

Returns
Type Description
ImageInfo

A new ImageInfo with the updated alignment.

View Source

WithFormat(PixelFormat)

Creates a new ImageInfo with a modified pixel format while keeping other properties unchanged.

Declaration
public ImageInfo WithFormat(PixelFormat format)
Parameters
Type Name Description
PixelFormat format

The new pixel format of the image.

Returns
Type Description
ImageInfo

A new ImageInfo with the updated pixel format.

View Source

WithHeight(int)

Creates a new ImageInfo with a modified height while keeping the other properties unchanged.

Declaration
public ImageInfo WithHeight(int height)
Parameters
Type Name Description
int height

The new height of the image.

Returns
Type Description
ImageInfo

A new ImageInfo with the updated height.

View Source

WithSize(int, int)

Creates a new ImageInfo with a modified size (width and height) while keeping other properties unchanged.

Declaration
public ImageInfo WithSize(int width, int height)
Parameters
Type Name Description
int width

The new width of the image.

int height

The new height of the image.

Returns
Type Description
ImageInfo

A new ImageInfo with the updated size.

View Source

WithWidth(int)

Creates a new ImageInfo with a modified width while keeping the other properties unchanged.

Declaration
public ImageInfo WithWidth(int width)
Parameters
Type Name Description
int width

The new width of the image.

Returns
Type Description
ImageInfo

A new ImageInfo with the updated width.

  • View Source
In this article
Back to top Generated by DocFX