Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(821)

Side by Side Diff: source/row_common.cc

Issue 1995293002: Add ARGBExtractAlpha function (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Use ANY11 instead of ANY11B Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 dst[3] = src[3]; 2374 dst[3] = src[3];
2375 dst[7] = src[7]; 2375 dst[7] = src[7];
2376 dst += 8; 2376 dst += 8;
2377 src += 8; 2377 src += 8;
2378 } 2378 }
2379 if (width & 1) { 2379 if (width & 1) {
2380 dst[3] = src[3]; 2380 dst[3] = src[3];
2381 } 2381 }
2382 } 2382 }
2383 2383
2384 void ARGBExtractAlphaRow_C(const uint8* src_argb, uint8* dst_a, int width) {
2385 int i;
2386 for (i = 0; i < width - 1; i += 2) {
2387 dst_a[0] = src_argb[3];
2388 dst_a[1] = src_argb[7];
2389 dst_a += 2;
2390 src_argb += 8;
2391 }
2392 if (width & 1) {
2393 dst_a[0] = src_argb[3];
2394 }
2395 }
2396
2384 void ARGBCopyYToAlphaRow_C(const uint8* src, uint8* dst, int width) { 2397 void ARGBCopyYToAlphaRow_C(const uint8* src, uint8* dst, int width) {
2385 int i; 2398 int i;
2386 for (i = 0; i < width - 1; i += 2) { 2399 for (i = 0; i < width - 1; i += 2) {
2387 dst[3] = src[0]; 2400 dst[3] = src[0];
2388 dst[7] = src[1]; 2401 dst[7] = src[1];
2389 dst += 8; 2402 dst += 8;
2390 src += 2; 2403 src += 2;
2391 } 2404 }
2392 if (width & 1) { 2405 if (width & 1) {
2393 dst[3] = src[0]; 2406 dst[3] = src[0];
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 dst_rgb565 += twidth * 2; 2618 dst_rgb565 += twidth * 2;
2606 width -= twidth; 2619 width -= twidth;
2607 } 2620 }
2608 } 2621 }
2609 #endif 2622 #endif
2610 2623
2611 #ifdef __cplusplus 2624 #ifdef __cplusplus
2612 } // extern "C" 2625 } // extern "C"
2613 } // namespace libyuv 2626 } // namespace libyuv
2614 #endif 2627 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698