Mercurial > libavcore.hg
changeset 23:478992775cf8 libavcore
Reimplement ff_img_copy_plane() as av_image_copy_plane() in libavcore,
and deprecate the old function.
author | stefano |
---|---|
date | Tue, 07 Sep 2010 21:23:45 +0000 |
parents | 0899fc09d43c |
children | c063c88b1309 |
files | avcore.h imgutils.c imgutils.h |
diffstat | 3 files changed, 27 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/avcore.h Tue Sep 07 19:15:17 2010 +0000 +++ b/avcore.h Tue Sep 07 21:23:45 2010 +0000 @@ -27,7 +27,7 @@ #include "libavutil/avutil.h" #define LIBAVCORE_VERSION_MAJOR 0 -#define LIBAVCORE_VERSION_MINOR 7 +#define LIBAVCORE_VERSION_MINOR 8 #define LIBAVCORE_VERSION_MICRO 0 #define LIBAVCORE_VERSION_INT AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \
--- a/imgutils.c Tue Sep 07 19:15:17 2010 +0000 +++ b/imgutils.c Tue Sep 07 21:23:45 2010 +0000 @@ -139,6 +139,19 @@ return AVERROR(EINVAL); } +void av_image_copy_plane(uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, + int bytewidth, int height) +{ + if (!dst || !src) + return; + for (;height > 0; height--) { + memcpy(dst, src, bytewidth); + dst += dst_linesize; + src += src_linesize; + } +} + #if FF_API_OLD_IMAGE_NAMES void av_fill_image_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc)
--- a/imgutils.h Tue Sep 07 19:15:17 2010 +0000 +++ b/imgutils.h Tue Sep 07 21:23:45 2010 +0000 @@ -78,6 +78,19 @@ uint8_t *ptr, const int linesizes[4]); /** + * Copy image plane from src to dst. + * That is, copy "height" number of lines of "bytewidth" bytes each. + * The first byte of each successive line is separated by *_linesize + * bytes. + * + * @param dst_linesize linesize for the image plane in dst + * @param src_linesize linesize for the image plane in src + */ +void av_image_copy_plane(uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, + int bytewidth, int height); + +/** * Check if the given dimension of an image is valid, meaning that all * bytes of the image can be addressed with a signed int. *