aboutsummaryrefslogtreecommitdiff
path: root/include/libyuv/planar_functions.h
diff options
context:
space:
mode:
authorYuan Tong <tongyuan200097@gmail.com>2021-01-27 08:55:58 +0800
committerFrank Barchard <fbarchard@chromium.org>2021-01-27 19:33:51 +0000
commita85cc26fde68699f95eceb4ca93c5eb70278787e (patch)
tree20b7fc40b2d60c528e69fae9c9d6f70b0ae1ed67 /include/libyuv/planar_functions.h
parentf7c0a73a3ea796e9b1c2a4cf2de319eafe6d1226 (diff)
downloadlibyuv-a85cc26fde68699f95eceb4ca93c5eb70278787e.tar.gz
Add MergeARGBPlane and SplitARGBPlane
These functions convert between planar and interleaved ARGB, optionally fill 255 to alpha / discard alpha. This can help handle YUV(A) with Identity matrix, which is basically planar ARGB. libyuv_unittest --gtest_filter=LibYUVPlanarTest.*ARGBPlane*:LibYUVPlanarTest.*XRGBPlane* R=fbarchard@google.com Change-Id: I522a189b434f490ba1723ce51317727e7c5eb112 Bug: libyuv:877 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2649887 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'include/libyuv/planar_functions.h')
-rw-r--r--include/libyuv/planar_functions.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/libyuv/planar_functions.h b/include/libyuv/planar_functions.h
index d1e55fb9..ce94e162 100644
--- a/include/libyuv/planar_functions.h
+++ b/include/libyuv/planar_functions.h
@@ -153,6 +153,38 @@ void MergeRGBPlane(const uint8_t* src_r,
int width,
int height);
+// Split interleaved ARGB plane into separate R, G, B and A planes.
+// dst_a can be NULL to discard alpha plane.
+LIBYUV_API
+void SplitARGBPlane(const uint8_t* src_argb,
+ int src_stride_argb,
+ uint8_t* dst_r,
+ int dst_stride_r,
+ uint8_t* dst_g,
+ int dst_stride_g,
+ uint8_t* dst_b,
+ int dst_stride_b,
+ uint8_t* dst_a,
+ int dst_stride_a,
+ int width,
+ int height);
+
+// Merge separate R, G, B and A planes into one interleaved ARGB plane.
+// src_a can be NULL to fill opaque value to alpha.
+LIBYUV_API
+void MergeARGBPlane(const uint8_t* src_r,
+ int src_stride_r,
+ const uint8_t* src_g,
+ int src_stride_g,
+ const uint8_t* src_b,
+ int src_stride_b,
+ const uint8_t* src_a,
+ int src_stride_a,
+ uint8_t* dst_argb,
+ int dst_stride_argb,
+ int width,
+ int height);
+
// Copy I400. Supports inverting.
LIBYUV_API
int I400ToI400(const uint8_t* src_y,