This means that it contains a fixed palette in the 2nd plane but the palette is fixed/constant for each PIX_FMT. This allows interpreting the data as if it was PAL8, which can in some cases be simpler. Or the data can be interpreted purely based on the pixel format without using the palette. An example of a pseudo-paletted format is AV_PIX_FMT_GRAY8

This is set on all formats that support alpha in some way. The exception is AV_PIX_FMT_PAL8, which can carry alpha as part of the palette. Details are explained in the AVPixelFormat enum, and are also encoded in the corresponding AVPixFmtDescriptor.

The alpha is always straight, never pre-multiplied.

If a codec or a filter does not support alpha, it should set all alpha to opaque, or use the equivalent pixel formats without alpha component, e.g. AV_PIX_FMT_RGB0 (or AV_PIX_FMT_RGB24 etc.) instead of AV_PIX_FMT_RGBA.

See av_get_chroma_sub_sample() for a function that asserts a valid pixel format instead of returning an error code. Its recommended that you use avcodec_get_chroma_sub_sample unless you do check the return code!

If there is no pixel format with name name, then looks for a pixel format with the name corresponding to the native endian format of name. For example in a little-endian system, first looks for "gray16", then for "gray16le".

Read a line from an image, and write the values of the pixel format component c to dst.

Parameters

data

the array containing the pointers to the planes of the image

linesize

the array containing the linesizes of the image

desc

the pixel format descriptor for the image

x

the horizontal coordinate of the first pixel to read

y

the vertical coordinate of the first pixel to read

w

the width of the line to read, that is the number of values to write to dst

read_pal_component

if not zero and the format is a paletted format writes the values corresponding to the palette component c in data[1] to dst, rather than the palette indexes in data[0]. The behavior is undefined if the format is not paletted.

Compute what kind of losses will occur when converting from one specific pixel format to another.

When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. av_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another.

Parameters

[in]

dst_pix_fmt

destination pixel format

[in]

src_pix_fmt

source pixel format

[in]

has_alpha

Whether the source pixel format alpha channel is used.

Returns

Combination of flags informing you what kind of losses will occur (maximum loss for an invalid dst_pix_fmt).

Compute what kind of losses will occur when converting from one specific pixel format to another.

When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. av_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another.

Parameters

[in]

dst_pix_fmt

destination pixel format

[in]

src_pix_fmt

source pixel format

[in]

has_alpha

Whether the source pixel format alpha channel is used.

Returns

Combination of flags informing you what kind of losses will occur (maximum loss for an invalid dst_pix_fmt).