22 #ifndef AVUTIL_PIXDESC_H
23 #define AVUTIL_PIXDESC_H
111 #define AV_PIX_FMT_FLAG_BE (1 << 0)
115 #define AV_PIX_FMT_FLAG_PAL (1 << 1)
119 #define AV_PIX_FMT_FLAG_BITSTREAM (1 << 2)
123 #define AV_PIX_FMT_FLAG_HWACCEL (1 << 3)
127 #define AV_PIX_FMT_FLAG_PLANAR (1 << 4)
131 #define AV_PIX_FMT_FLAG_RGB (1 << 5)
141 #define AV_PIX_FMT_FLAG_PSEUDOPAL (1 << 6)
156 #define AV_PIX_FMT_FLAG_ALPHA (1 << 7)
162 #define PIX_FMT_BE AV_PIX_FMT_FLAG_BE
163 #define PIX_FMT_PAL AV_PIX_FMT_FLAG_PAL
164 #define PIX_FMT_BITSTREAM AV_PIX_FMT_FLAG_BITSTREAM
165 #define PIX_FMT_HWACCEL AV_PIX_FMT_FLAG_HWACCEL
166 #define PIX_FMT_PLANAR AV_PIX_FMT_FLAG_PLANAR
167 #define PIX_FMT_RGB AV_PIX_FMT_FLAG_RGB
168 #define PIX_FMT_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
169 #define PIX_FMT_ALPHA AV_PIX_FMT_FLAG_ALPHA
172 #if FF_API_PIX_FMT_DESC
197 int x,
int y,
int c,
int w,
int read_pal_component);
215 int x,
int y,
int c,
int w);
305 int *h_shift,
int *v_shift);
323 #define FF_LOSS_RESOLUTION 0x0001
324 #define FF_LOSS_DEPTH 0x0002
325 #define FF_LOSS_COLORSPACE 0x0004
326 #define FF_LOSS_ALPHA 0x0008
327 #define FF_LOSS_COLORQUANT 0x0010
328 #define FF_LOSS_CHROMA 0x0020
371 enum AVPixelFormat src_pix_fmt,
int has_alpha,
int *loss_ptr);
static enum AVPixelFormat pix_fmt
const char * alias
Alternative comma-separated names.
ptrdiff_t const GLvoid * data
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)
Read a line from an image, and write the values of the pixel format component c to dst...
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
AVColorTransferCharacteristic
Color Transfer Characteristic.
uint16_t shift
Number of least significant bits that must be shifted away to get the value.
Macro definitions for various function/variable attributes.
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...
enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
Utility function to swap the endianness of a pixel format.
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
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)
Write the values from src to the pixel format component c of an image line.
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
AVColorSpace
YUV colorspace type.
AVColorRange
MPEG vs JPEG YUV range.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
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.
uint16_t depth_minus1
Number of bits in the component minus 1.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
const char * av_color_range_name(enum AVColorRange range)
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
uint8_t nb_components
The number of components each pixel has, (1-4)
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 AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
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...
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
const char * av_chroma_location_name(enum AVChromaLocation location)
uint16_t step_minus1
Number of elements between 2 horizontally consecutive pixels minus 1.
#define attribute_deprecated
uint16_t plane
Which of the 4 planes contains the component.
attribute_deprecated const AVPixFmtDescriptor av_pix_fmt_descriptors[]
The array of all the pixel format descriptors.
uint16_t offset_plus1
Number of elements before the component of the first pixel plus 1.
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.
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 ...
AVChromaLocation
Location of chroma samples.
AVPixelFormat
Pixel format.
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...
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.