From 2a35da39126a2dd3d5725c37e7326eb52521291d Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Mon, 2 Jun 2014 19:24:57 +0000 Subject: [PATCH] Add ARGBToABGR and ARGBToBGRA as actual functions instead of macros. BUG=334 TESTED=libyuv unittests pass R=tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/12659006 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1008 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/convert_from_argb.h | 18 ++++++++---------- include/libyuv/version.h | 2 +- source/convert_argb.cc | 22 ++++++++++++++++++++++ 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/README.chromium b/README.chromium index 78d39a64e..9c3ff5133 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1007 +Version: 1008 License: BSD License File: LICENSE diff --git a/include/libyuv/convert_from_argb.h b/include/libyuv/convert_from_argb.h index f0343a77d..90f43af04 100644 --- a/include/libyuv/convert_from_argb.h +++ b/include/libyuv/convert_from_argb.h @@ -25,24 +25,22 @@ int ARGBCopy(const uint8* src_argb, int src_stride_argb, uint8* dst_argb, int dst_stride_argb, int width, int height); -// Convert ARGB To BGRA. (alias) -#define ARGBToBGRA BGRAToARGB +// Convert ARGB To BGRA. LIBYUV_API -int BGRAToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, +int ARGBToBGRA(const uint8* src_argb, int src_stride_argb, + uint8* dst_bgra, int dst_stride_bgra, int width, int height); -// Convert ARGB To ABGR. (alias) -#define ARGBToABGR ABGRToARGB +// Convert ARGB To ABGR. LIBYUV_API -int ABGRToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, +int ARGBToABGR(const uint8* src_argb, int src_stride_argb, + uint8* dst_abgr, int dst_stride_abgr, int width, int height); // Convert ARGB To RGBA. LIBYUV_API -int ARGBToRGBA(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, +int ARGBToRGBA(const uint8* src_argb, int src_stride_argb, + uint8* dst_rgba, int dst_stride_rgba, int width, int height); // Convert ARGB To RGB24. diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 16faa9b1d..75dbb938c 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1007 +#define LIBYUV_VERSION 1008 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/convert_argb.cc b/source/convert_argb.cc index a8aab9147..5f97f641a 100644 --- a/source/convert_argb.cc +++ b/source/convert_argb.cc @@ -372,6 +372,17 @@ int BGRAToARGB(const uint8* src_bgra, int src_stride_bgra, width, height); } +// Convert ARGB to BGRA (same as BGRAToARGB). +LIBYUV_API +int ARGBToBGRA(const uint8* src_bgra, int src_stride_bgra, + uint8* dst_argb, int dst_stride_argb, + int width, int height) { + return ARGBShuffle(src_bgra, src_stride_bgra, + dst_argb, dst_stride_argb, + (const uint8*)(&kShuffleMaskBGRAToARGB), + width, height); +} + // Convert ABGR to ARGB. LIBYUV_API int ABGRToARGB(const uint8* src_abgr, int src_stride_abgr, @@ -383,6 +394,17 @@ int ABGRToARGB(const uint8* src_abgr, int src_stride_abgr, width, height); } +// Convert ARGB to ABGR to (same as ABGRToARGB). +LIBYUV_API +int ARGBToABGR(const uint8* src_abgr, int src_stride_abgr, + uint8* dst_argb, int dst_stride_argb, + int width, int height) { + return ARGBShuffle(src_abgr, src_stride_abgr, + dst_argb, dst_stride_argb, + (const uint8*)(&kShuffleMaskABGRToARGB), + width, height); +} + // Convert RGBA to ARGB. LIBYUV_API int RGBAToARGB(const uint8* src_rgba, int src_stride_rgba,