From b2720dba0f7427cf23be889f7c87ab25d9c6da85 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 2 May 2020 23:48:43 +0200 Subject: mp_image: add some helpers This is really basic for planar image data access; not sure why there weren't such helpers before. They also handle trickier formats that use bit-packing, or they would be mich simpler. (This affects only BGR4/BGR4/MONOW/MONOH, I hope whoever invented them is proud of triggering so many special cases for so little gain.) --- video/mp_image.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'video/mp_image.h') diff --git a/video/mp_image.h b/video/mp_image.h index e51022dd5c..f111d35129 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -185,4 +185,7 @@ void memcpy_pic(void *dst, const void *src, int bytesPerLine, int height, void memset_pic(void *dst, int fill, int bytesPerLine, int height, int stride); void memset16_pic(void *dst, int fill, int unitsPerLine, int height, int stride); +void *mp_image_pixel_ptr(struct mp_image *img, int plane, int x, int y); +size_t mp_image_plane_bytes(struct mp_image *img, int plane, int x0, int w); + #endif /* MPLAYER_MP_IMAGE_H */ -- cgit v1.2.3