| OLD | NEW |
| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 uint8 b = src_raw[2]; | 93 uint8 b = src_raw[2]; |
| 94 dst_argb[0] = b; | 94 dst_argb[0] = b; |
| 95 dst_argb[1] = g; | 95 dst_argb[1] = g; |
| 96 dst_argb[2] = r; | 96 dst_argb[2] = r; |
| 97 dst_argb[3] = 255u; | 97 dst_argb[3] = 255u; |
| 98 dst_argb += 4; | 98 dst_argb += 4; |
| 99 src_raw += 3; | 99 src_raw += 3; |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 void RAWToRGB24Row_C(const uint8* src_raw, uint8* dst_rgb24, int width) { |
| 104 int x; |
| 105 for (x = 0; x < width; ++x) { |
| 106 uint8 r = src_raw[0]; |
| 107 uint8 g = src_raw[1]; |
| 108 uint8 b = src_raw[2]; |
| 109 dst_rgb24[0] = b; |
| 110 dst_rgb24[1] = g; |
| 111 dst_rgb24[2] = r; |
| 112 dst_rgb24 += 3; |
| 113 src_raw += 3; |
| 114 } |
| 115 } |
| 116 |
| 103 void RGB565ToARGBRow_C(const uint8* src_rgb565, uint8* dst_argb, int width) { | 117 void RGB565ToARGBRow_C(const uint8* src_rgb565, uint8* dst_argb, int width) { |
| 104 int x; | 118 int x; |
| 105 for (x = 0; x < width; ++x) { | 119 for (x = 0; x < width; ++x) { |
| 106 uint8 b = src_rgb565[0] & 0x1f; | 120 uint8 b = src_rgb565[0] & 0x1f; |
| 107 uint8 g = (src_rgb565[0] >> 5) | ((src_rgb565[1] & 0x07) << 3); | 121 uint8 g = (src_rgb565[0] >> 5) | ((src_rgb565[1] & 0x07) << 3); |
| 108 uint8 r = src_rgb565[1] >> 3; | 122 uint8 r = src_rgb565[1] >> 3; |
| 109 dst_argb[0] = (b << 3) | (b >> 2); | 123 dst_argb[0] = (b << 3) | (b >> 2); |
| 110 dst_argb[1] = (g << 2) | (g >> 4); | 124 dst_argb[1] = (g << 2) | (g >> 4); |
| 111 dst_argb[2] = (r << 3) | (r >> 2); | 125 dst_argb[2] = (r << 3) | (r >> 2); |
| 112 dst_argb[3] = 255u; | 126 dst_argb[3] = 255u; |
| (...skipping 2484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2597 dst_rgb565 += twidth * 2; | 2611 dst_rgb565 += twidth * 2; |
| 2598 width -= twidth; | 2612 width -= twidth; |
| 2599 } | 2613 } |
| 2600 } | 2614 } |
| 2601 #endif | 2615 #endif |
| 2602 | 2616 |
| 2603 #ifdef __cplusplus | 2617 #ifdef __cplusplus |
| 2604 } // extern "C" | 2618 } // extern "C" |
| 2605 } // namespace libyuv | 2619 } // namespace libyuv |
| 2606 #endif | 2620 #endif |
| OLD | NEW |