aboutsummaryrefslogtreecommitdiff
path: root/source/scale_argb.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2015-11-13 11:25:56 -0800
committerFrank Barchard <fbarchard@google.com>2015-11-13 11:25:56 -0800
commit60adcbaf323cfa6b7a2ea408f3c904341a1998c7 (patch)
treea489ce23f0590ed83ce4cdcb6dbda19e307ce884 /source/scale_argb.cc
parent6100f50f136829b9769baf79306b31e0665ec16a (diff)
downloadlibyuv-60adcbaf323cfa6b7a2ea408f3c904341a1998c7.tar.gz
scale with conversion using 2 steps with unittest
a prototype function to implement the yuv to rgb with conversion and scale. replace with 1 step function in future version, using same API. R=harryjin@google.com BUG=libyuv:471 Review URL: https://codereview.chromium.org/1421553016 .
Diffstat (limited to 'source/scale_argb.cc')
-rw-r--r--source/scale_argb.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/source/scale_argb.cc b/source/scale_argb.cc
index 40a2d1ab..132581cc 100644
--- a/source/scale_argb.cc
+++ b/source/scale_argb.cc
@@ -847,6 +847,37 @@ int ARGBScale(const uint8* src_argb, int src_stride_argb,
return 0;
}
+// Scale with YUV conversion to ARGB and clipping.
+LIBYUV_API
+int YUVToARGBScaleClip(const uint8* src_y, int src_stride_y,
+ const uint8* src_u, int src_stride_u,
+ const uint8* src_v, int src_stride_v,
+ uint32 src_fourcc,
+ int src_width, int src_height,
+ uint8* dst_argb, int dst_stride_argb,
+ uint32 dst_fourcc,
+ int dst_width, int dst_height,
+ int clip_x, int clip_y, int clip_width, int clip_height,
+ enum FilterMode filtering) {
+
+ uint8* argb_buffer = (uint8*)malloc(src_width * src_height * 4);
+ int r;
+ I420ToARGB(src_y, src_stride_y,
+ src_u, src_stride_u,
+ src_v, src_stride_v,
+ argb_buffer, src_width * 4,
+ src_width, src_height);
+
+ r = ARGBScaleClip(argb_buffer, src_width * 4,
+ src_width, src_height,
+ dst_argb, dst_stride_argb,
+ dst_width, dst_height,
+ clip_x, clip_y, clip_width, clip_height,
+ filtering);
+ free(argb_buffer);
+ return r;
+}
+
#ifdef __cplusplus
} // extern "C"
} // namespace libyuv