Libav
|
Functions for working with AVPicture. More...
Data Structures | |
struct | AVPicture |
four components are given, that's all. More... | |
Functions | |
int | avpicture_alloc (AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height) |
Allocate memory for a picture. More... | |
void | avpicture_free (AVPicture *picture) |
Free a picture previously allocated by avpicture_alloc(). More... | |
int | avpicture_fill (AVPicture *picture, uint8_t *ptr, enum AVPixelFormat pix_fmt, int width, int height) |
Fill in the AVPicture fields. More... | |
int | avpicture_layout (const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size) |
Copy pixel data from an AVPicture into a buffer. More... | |
int | avpicture_get_size (enum AVPixelFormat pix_fmt, int width, int height) |
Calculate the size in bytes that a picture of the given width and height would occupy if stored in the given picture format. More... | |
attribute_deprecated int | avpicture_deinterlace (AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height) |
deinterlace - if not supported return -1 More... | |
void | av_picture_copy (AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height) |
Copy image src to dst. More... | |
int | av_picture_crop (AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int top_band, int left_band) |
Crop image top and left side. More... | |
int | av_picture_pad (AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color) |
Pad image. More... | |
Functions for working with AVPicture.
int avpicture_alloc | ( | AVPicture * | picture, |
enum AVPixelFormat | pix_fmt, | ||
int | width, | ||
int | height | ||
) |
Allocate memory for a picture.
Call avpicture_free() to free it.
picture | the picture to be filled in |
pix_fmt | the format of the picture |
width | the width of the picture |
height | the height of the picture |
Definition at line 101 of file avpicture.c.
Referenced by ff_create_schro_frame(), and qtrle_encode_init().
Free a picture previously allocated by avpicture_alloc().
The data buffer used by the AVPicture is freed, but the AVPicture structure itself is not.
picture | the AVPicture to be freed |
Definition at line 114 of file avpicture.c.
Referenced by free_schro_frame(), and qtrle_encode_end().
int avpicture_fill | ( | AVPicture * | picture, |
uint8_t * | ptr, | ||
enum AVPixelFormat | pix_fmt, | ||
int | width, | ||
int | height | ||
) |
Fill in the AVPicture fields.
The fields of the given AVPicture are filled in by using the 'ptr' address which points to the image data buffer. Depending on the specified picture format, one or multiple image data pointers and line sizes will be set. If a planar format is specified, several pointers will be set pointing to the different picture planes and the line sizes of the different planes will be stored in the lines_sizes array. Call with ptr == NULL to get the required size for the ptr buffer.
To allocate the buffer and fill in the AVPicture fields in one call, use avpicture_alloc().
picture | AVPicture whose fields are to be filled in |
ptr | Buffer which will contain or contains the actual image data |
pix_fmt | The format in which the picture data is stored. |
width | the width of the image in pixels |
height | the height of the image in pixels |
Definition at line 34 of file avpicture.c.
Referenced by avpicture_get_size(), copy_frame(), and raw_decode().
int avpicture_layout | ( | const AVPicture * | src, |
enum AVPixelFormat | pix_fmt, | ||
int | width, | ||
int | height, | ||
unsigned char * | dest, | ||
int | dest_size | ||
) |
Copy pixel data from an AVPicture into a buffer.
The data is stored compactly, without any gaps for alignment or padding which may be applied by avpicture_fill().
[in] | src | AVPicture containing image data |
[in] | pix_fmt | The format in which the picture data is stored. |
[in] | width | the width of the image in pixels. |
[in] | height | the height of the image in pixels. |
[out] | dest | A buffer into which picture data will be copied. |
[in] | dest_size | The size of 'dest'. |
Definition at line 49 of file avpicture.c.
Referenced by encode_frame(), libschroedinger_frame_from_data(), and raw_encode().
int avpicture_get_size | ( | enum AVPixelFormat | pix_fmt, |
int | width, | ||
int | height | ||
) |
Calculate the size in bytes that a picture of the given width and height would occupy if stored in the given picture format.
Note that this returns the size of a compact representation as generated by avpicture_layout(), which can be smaller than the size required for e.g. avpicture_fill().
pix_fmt | the given picture format |
width | the width of the image |
height | the height of the image |
Definition at line 85 of file avpicture.c.
Referenced by avpicture_layout(), dc1394_read_common(), encode_frame(), libschroedinger_encode_init(), pam_encode_frame(), pnm_encode_frame(), pnm_parse(), raw_encode(), raw_init_decoder(), rawvideo_read_packet(), targa_encode_frame(), v4l2_read_header(), vble_decode_init(), and yuv4_read_packet().
attribute_deprecated int avpicture_deinterlace | ( | AVPicture * | dst, |
const AVPicture * | src, | ||
enum AVPixelFormat | pix_fmt, | ||
int | width, | ||
int | height | ||
) |
deinterlace - if not supported return -1
Definition at line 455 of file imgconvert.c.
void av_picture_copy | ( | AVPicture * | dst, |
const AVPicture * | src, | ||
enum AVPixelFormat | pix_fmt, | ||
int | width, | ||
int | height | ||
) |
Copy image src to dst.
Wraps av_picture_data_copy() above.
Definition at line 119 of file avpicture.c.
Referenced by copy_frame(), qtrle_encode_frame(), queue_picture(), and roq_decode_frame().
int av_picture_crop | ( | AVPicture * | dst, |
const AVPicture * | src, | ||
enum AVPixelFormat | pix_fmt, | ||
int | top_band, | ||
int | left_band | ||
) |
Crop image top and left side.
Definition at line 255 of file imgconvert.c.
int av_picture_pad | ( | AVPicture * | dst, |
const AVPicture * | src, | ||
int | height, | ||
int | width, | ||
enum AVPixelFormat | pix_fmt, | ||
int | padtop, | ||
int | padbottom, | ||
int | padleft, | ||
int | padright, | ||
int * | color | ||
) |
Pad image.
Definition at line 278 of file imgconvert.c.