AVPicture
[Core functions/structures.]

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 PixelFormat pix_fmt, int width, int height)
 Allocate memory for a picture.
void avpicture_free (AVPicture *picture)
 Free a picture previously allocated by avpicture_alloc().
int avpicture_fill (AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, int width, int height)
 Fill in the AVPicture fields.
int avpicture_layout (const AVPicture *src, enum PixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size)
 Copy pixel data from an AVPicture into a buffer.
int avpicture_get_size (enum PixelFormat 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.
int avpicture_deinterlace (AVPicture *dst, const AVPicture *src, enum PixelFormat pix_fmt, int width, int height)
 deinterlace - if not supported return -1
void av_picture_copy (AVPicture *dst, const AVPicture *src, enum PixelFormat pix_fmt, int width, int height)
 Copy image src to dst.
int av_picture_crop (AVPicture *dst, const AVPicture *src, enum PixelFormat pix_fmt, int top_band, int left_band)
 Crop image top and left side.
int av_picture_pad (AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color)
 Pad image.


Detailed Description

Functions for working with AVPicture.

Function Documentation

void av_picture_copy ( AVPicture dst,
const AVPicture src,
enum PixelFormat  pix_fmt,
int  width,
int  height 
)

Copy image src to dst.

Wraps av_picture_data_copy() above.

Definition at line 521 of file imgconvert.c.

Referenced by avcodec_default_reget_buffer(), copy_frame(), qtrle_encode_frame(), queue_picture(), and roq_decode_frame().

int av_picture_crop ( AVPicture dst,
const AVPicture src,
enum PixelFormat  pix_fmt,
int  top_band,
int  left_band 
)

Crop image top and left side.

Definition at line 656 of file imgconvert.c.

int av_picture_pad ( AVPicture dst,
const AVPicture src,
int  height,
int  width,
enum PixelFormat  pix_fmt,
int  padtop,
int  padbottom,
int  padleft,
int  padright,
int *  color 
)

Pad image.

Definition at line 686 of file imgconvert.c.

int avpicture_alloc ( AVPicture picture,
enum PixelFormat  pix_fmt,
int  width,
int  height 
)

Allocate memory for a picture.

Call avpicture_free() to free it.

See also:
avpicture_fill()
Parameters:
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
Returns:
zero if successful, a negative value if not

Definition at line 615 of file imgconvert.c.

Referenced by ff_create_schro_frame(), and qtrle_encode_init().

int avpicture_deinterlace ( AVPicture dst,
const AVPicture src,
enum PixelFormat  pix_fmt,
int  width,
int  height 
)

deinterlace - if not supported return -1

Definition at line 854 of file imgconvert.c.

Referenced by pre_process_video_frame().

int avpicture_fill ( AVPicture picture,
uint8_t ptr,
enum PixelFormat  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().

Parameters:
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
Returns:
size of the image data in bytes

Definition at line 296 of file imgconvert.c.

Referenced by alloc_picture(), avpicture_get_size(), copy_frame(), do_streamcopy(), pre_process_video_frame(), raw_decode(), and sdl_write_packet().

void avpicture_free ( AVPicture picture  ) 

Free a picture previously allocated by avpicture_alloc().

The data buffer used by the AVPicture is freed, but the AVPicture structure itself is not.

Parameters:
picture the AVPicture to be freed

Definition at line 628 of file imgconvert.c.

Referenced by free_schro_frame(), and qtrle_encode_end().

int avpicture_get_size ( enum PixelFormat  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().

Parameters:
pix_fmt the given picture format
width the width of the image
height the height of the image
Returns:
Image data size in bytes or -1 on error (e.g. too large dimensions).

Definition at line 356 of file imgconvert.c.

Referenced by alloc_picture(), avpicture_layout(), dc1394_read_common(), encode_frame(), lavfi_read_packet(), libschroedinger_encode_init(), pnm_encode_frame(), pnm_parse(), pre_process_video_frame(), raw_encode(), raw_init_decoder(), rawvideo_read_packet(), targa_encode_frame(), utvideo_decode_init(), utvideo_encode_init(), v4l2_read_header(), vble_decode_init(), yuv4_read_packet(), and zerocodec_decode_init().

int avpicture_layout ( const AVPicture src,
enum PixelFormat  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().

See also:
avpicture_get_size()
Parameters:
[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'.
Returns:
The number of bytes written to dest, or a negative value (error code) on error.

Definition at line 310 of file imgconvert.c.

Referenced by encode_frame(), lavfi_read_packet(), libschroedinger_frame_from_data(), and raw_encode().


Generated on Fri Oct 26 02:48:04 2012 for FFmpeg by  doxygen 1.5.8