AVPicture中函数功能介绍

本文详细介绍了FFmpeg中关于图片处理的一系列函数,包括分配、填充、布局计算、大小计算等核心功能。通过这些函数,可以实现图片的内存分配与释放、像素数据的填充与复制等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

具体的请参考:http://ffmpeg.org/doxygen/trunk/group__lavc__picture.html

int avpicture_alloc (AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height)
 Allocate memory for the pixels of a picture and setup the AVPicture fields for it. 
 
void avpicture_free (AVPicture *picture)//释放内存
 Free a picture previously allocated by avpicture_alloc()
 
int avpicture_fill (AVPicture *picture, const uint8_t *ptr, enum AVPixelFormat pix_fmt, int width, int height)//把ptr和picture以pix_fmt格式关联起来,意思就是指针ptr=picture
 Setup the picture fields based on the specified image parameters and the provided image data buffer. 
 
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. 
 
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. 
 
attribute_deprecated int avpicture_deinterlace (AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height)
 deinterlace - if not supported return -1 
 
void av_picture_copy (AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height)
 Copy image src to dst. 
 
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. 
 
int av_picture_pad

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值