summaryrefslogtreecommitdiff
path: root/libavcore
diff options
context:
space:
mode:
Diffstat (limited to 'libavcore')
-rw-r--r--libavcore/avcore.h2
-rw-r--r--libavcore/imgutils.c13
-rw-r--r--libavcore/imgutils.h13
3 files changed, 27 insertions, 1 deletions
diff --git a/libavcore/avcore.h b/libavcore/avcore.h
index d11ae3866e..57ac487b99 100644
--- a/libavcore/avcore.h
+++ b/libavcore/avcore.h
@@ -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, \
diff --git a/libavcore/imgutils.c b/libavcore/imgutils.c
index b75413eb67..c891212009 100644
--- a/libavcore/imgutils.c
+++ b/libavcore/imgutils.c
@@ -139,6 +139,19 @@ int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *lo
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)
diff --git a/libavcore/imgutils.h b/libavcore/imgutils.h
index 291c872419..879281d0c9 100644
--- a/libavcore/imgutils.h
+++ b/libavcore/imgutils.h
@@ -78,6 +78,19 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh
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.
*