22#ifndef AVUTIL_PIXDESC_H
23#define AVUTIL_PIXDESC_H
116#define AV_PIX_FMT_FLAG_BE (1 << 0)
120#define AV_PIX_FMT_FLAG_PAL (1 << 1)
124#define AV_PIX_FMT_FLAG_BITSTREAM (1 << 2)
128#define AV_PIX_FMT_FLAG_HWACCEL (1 << 3)
132#define AV_PIX_FMT_FLAG_PLANAR (1 << 4)
136#define AV_PIX_FMT_FLAG_RGB (1 << 5)
147#define AV_PIX_FMT_FLAG_ALPHA (1 << 7)
152#define AV_PIX_FMT_FLAG_BAYER (1 << 8)
158#define AV_PIX_FMT_FLAG_FLOAT (1 << 9)
209 int *h_shift,
int *v_shift);
320 int x,
int y,
int c,
int w,
int read_pal_component,
321 int dst_element_size);
325 int x,
int y,
int c,
int w,
int read_pal_component);
344 int x,
int y,
int c,
int w,
int src_element_size);
348 int x,
int y,
int c,
int w);
360#define FF_LOSS_RESOLUTION 0x0001
361#define FF_LOSS_DEPTH 0x0002
362#define FF_LOSS_COLORSPACE 0x0004
363#define FF_LOSS_ALPHA 0x0008
364#define FF_LOSS_COLORQUANT 0x0010
365#define FF_LOSS_CHROMA 0x0020
408 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
Macro definitions for various function/variable attributes.
static enum AVPixelFormat pix_fmt
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
int av_color_space_from_name(const char *name)
void av_write_image_line2(const void *src, uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int src_element_size)
Write the values from src to the pixel format component c of an image line.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
int av_chroma_location_from_name(const char *name)
int av_color_transfer_from_name(const char *name)
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
const char * av_color_space_name(enum AVColorSpace space)
const char * av_color_range_name(enum AVColorRange range)
int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, int has_alpha)
Compute what kind of losses will occur when converting from one specific pixel format to another.
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
void av_read_image_line2(void *dst, const uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component, int dst_element_size)
Read a line from an image, and write the values of the pixel format component c to dst.
enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
Compute what kind of losses will occur when converting from one specific pixel format to another.
void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w)
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
const char * av_chroma_location_name(enum AVChromaLocation location)
int av_color_range_from_name(const char *name)
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
int av_color_primaries_from_name(const char *name)
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
Utility function to swap the endianness of a pixel format.
char * av_get_pix_fmt_string(char *buf, int buf_size, enum AVPixelFormat pix_fmt)
Print in buf the string corresponding to the pixel format with number pix_fmt, or a header if pix_fmt...
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
AVChromaLocation
Location of chroma samples.
AVColorRange
Visual content value range.
AVPixelFormat
Pixel format.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
AVColorTransferCharacteristic
Color Transfer Characteristic.
AVColorSpace
YUV colorspace type.
int shift
Number of least significant bits that must be shifted away to get the value.
int offset
Number of elements before the component of the first pixel.
int plane
Which of the 4 planes contains the component.
int step
Number of elements between 2 horizontally consecutive pixels.
int depth
Number of bits in the component.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint64_t flags
Combination of AV_PIX_FMT_FLAG_... flags.
const char * alias
Alternative comma-separated names.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
uint8_t nb_components
The number of components each pixel has, (1-4)