OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2012 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 int ARGBToRAW(const uint8* src_argb, int src_stride_argb, | 54 int ARGBToRAW(const uint8* src_argb, int src_stride_argb, |
55 uint8* dst_rgb, int dst_stride_rgb, | 55 uint8* dst_rgb, int dst_stride_rgb, |
56 int width, int height); | 56 int width, int height); |
57 | 57 |
58 // Convert ARGB To RGB565. | 58 // Convert ARGB To RGB565. |
59 LIBYUV_API | 59 LIBYUV_API |
60 int ARGBToRGB565(const uint8* src_argb, int src_stride_argb, | 60 int ARGBToRGB565(const uint8* src_argb, int src_stride_argb, |
61 uint8* dst_rgb565, int dst_stride_rgb565, | 61 uint8* dst_rgb565, int dst_stride_rgb565, |
62 int width, int height); | 62 int width, int height); |
63 | 63 |
64 // Convert ARGB To RGB565 with 8x8 dither matrix (64 bytes). | 64 // Convert ARGB To RGB565 with 4x4 dither matrix (16 bytes). |
65 // Values in dither matrix from 0 to 255. 128 is best for no dither. | 65 // Values in dither matrix from 0 to 7 recommended. |
| 66 // The order of the dither matrix is first byte is upper left. |
| 67 // TODO(fbarchard): Consider pointer to 2d array for dither4x4. |
| 68 // const uint8(*dither)[4][4]; |
66 LIBYUV_API | 69 LIBYUV_API |
67 int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb, | 70 int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb, |
68 uint8* dst_rgb565, int dst_stride_rgb565, | 71 uint8* dst_rgb565, int dst_stride_rgb565, |
69 const uint8* dither8x8, int width, int height); | 72 const uint8* dither4x4, int width, int height); |
70 | 73 |
71 // Convert ARGB To ARGB1555. | 74 // Convert ARGB To ARGB1555. |
72 LIBYUV_API | 75 LIBYUV_API |
73 int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb, | 76 int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb, |
74 uint8* dst_argb1555, int dst_stride_argb1555, | 77 uint8* dst_argb1555, int dst_stride_argb1555, |
75 int width, int height); | 78 int width, int height); |
76 | 79 |
77 // Convert ARGB To ARGB4444. | 80 // Convert ARGB To ARGB4444. |
78 LIBYUV_API | 81 LIBYUV_API |
79 int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb, | 82 int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 int ARGBToJ400(const uint8* src_argb, int src_stride_argb, | 136 int ARGBToJ400(const uint8* src_argb, int src_stride_argb, |
134 uint8* dst_yj, int dst_stride_yj, | 137 uint8* dst_yj, int dst_stride_yj, |
135 int width, int height); | 138 int width, int height); |
136 | 139 |
137 // Convert ARGB to I400. | 140 // Convert ARGB to I400. |
138 LIBYUV_API | 141 LIBYUV_API |
139 int ARGBToI400(const uint8* src_argb, int src_stride_argb, | 142 int ARGBToI400(const uint8* src_argb, int src_stride_argb, |
140 uint8* dst_y, int dst_stride_y, | 143 uint8* dst_y, int dst_stride_y, |
141 int width, int height); | 144 int width, int height); |
142 | 145 |
| 146 // Convert ARGB to G. (Reverse of J400toARGB, which replicates G back to ARGB) |
| 147 LIBYUV_API |
| 148 int ARGBToG(const uint8* src_argb, int src_stride_argb, |
| 149 uint8* dst_g, int dst_stride_g, |
| 150 int width, int height); |
| 151 |
143 // Convert ARGB To NV12. | 152 // Convert ARGB To NV12. |
144 LIBYUV_API | 153 LIBYUV_API |
145 int ARGBToNV12(const uint8* src_argb, int src_stride_argb, | 154 int ARGBToNV12(const uint8* src_argb, int src_stride_argb, |
146 uint8* dst_y, int dst_stride_y, | 155 uint8* dst_y, int dst_stride_y, |
147 uint8* dst_uv, int dst_stride_uv, | 156 uint8* dst_uv, int dst_stride_uv, |
148 int width, int height); | 157 int width, int height); |
149 | 158 |
150 // Convert ARGB To NV21. | 159 // Convert ARGB To NV21. |
151 LIBYUV_API | 160 LIBYUV_API |
152 int ARGBToNV21(const uint8* src_argb, int src_stride_argb, | 161 int ARGBToNV21(const uint8* src_argb, int src_stride_argb, |
(...skipping 19 matching lines...) Expand all Loading... |
172 int ARGBToUYVY(const uint8* src_argb, int src_stride_argb, | 181 int ARGBToUYVY(const uint8* src_argb, int src_stride_argb, |
173 uint8* dst_uyvy, int dst_stride_uyvy, | 182 uint8* dst_uyvy, int dst_stride_uyvy, |
174 int width, int height); | 183 int width, int height); |
175 | 184 |
176 #ifdef __cplusplus | 185 #ifdef __cplusplus |
177 } // extern "C" | 186 } // extern "C" |
178 } // namespace libyuv | 187 } // namespace libyuv |
179 #endif | 188 #endif |
180 | 189 |
181 #endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ NOLINT | 190 #endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ NOLINT |
OLD | NEW |