webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
convert_from_argb.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012 The LibYuv Project Authors. All rights reserved.
3  *
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
6  * tree. An additional intellectual property rights grant can be found
7  * in the file PATENTS. All contributing project authors may
8  * be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
12 #define INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
13 
14 #include "libyuv/basic_types.h"
15 
16 #ifdef __cplusplus
17 namespace libyuv {
18 extern "C" {
19 #endif
20 
21 // Copy ARGB to ARGB.
22 #define ARGBToARGB ARGBCopy
24 int ARGBCopy(const uint8* src_argb, int src_stride_argb,
25  uint8* dst_argb, int dst_stride_argb,
26  int width, int height);
27 
28 // Convert ARGB To BGRA.
30 int ARGBToBGRA(const uint8* src_argb, int src_stride_argb,
31  uint8* dst_bgra, int dst_stride_bgra,
32  int width, int height);
33 
34 // Convert ARGB To ABGR.
36 int ARGBToABGR(const uint8* src_argb, int src_stride_argb,
37  uint8* dst_abgr, int dst_stride_abgr,
38  int width, int height);
39 
40 // Convert ARGB To RGBA.
42 int ARGBToRGBA(const uint8* src_argb, int src_stride_argb,
43  uint8* dst_rgba, int dst_stride_rgba,
44  int width, int height);
45 
46 // Convert ARGB To RGB24.
48 int ARGBToRGB24(const uint8* src_argb, int src_stride_argb,
49  uint8* dst_rgb24, int dst_stride_rgb24,
50  int width, int height);
51 
52 // Convert ARGB To RAW.
54 int ARGBToRAW(const uint8* src_argb, int src_stride_argb,
55  uint8* dst_rgb, int dst_stride_rgb,
56  int width, int height);
57 
58 // Convert ARGB To RGB565.
60 int ARGBToRGB565(const uint8* src_argb, int src_stride_argb,
61  uint8* dst_rgb565, int dst_stride_rgb565,
62  int width, int height);
63 
64 // Convert ARGB To RGB565 with 4x4 dither matrix (16 bytes).
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];
70 int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb,
71  uint8* dst_rgb565, int dst_stride_rgb565,
72  const uint8* dither4x4, int width, int height);
73 
74 // Convert ARGB To ARGB1555.
76 int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb,
77  uint8* dst_argb1555, int dst_stride_argb1555,
78  int width, int height);
79 
80 // Convert ARGB To ARGB4444.
82 int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb,
83  uint8* dst_argb4444, int dst_stride_argb4444,
84  int width, int height);
85 
86 // Convert ARGB To I444.
88 int ARGBToI444(const uint8* src_argb, int src_stride_argb,
89  uint8* dst_y, int dst_stride_y,
90  uint8* dst_u, int dst_stride_u,
91  uint8* dst_v, int dst_stride_v,
92  int width, int height);
93 
94 // Convert ARGB To I422.
96 int ARGBToI422(const uint8* src_argb, int src_stride_argb,
97  uint8* dst_y, int dst_stride_y,
98  uint8* dst_u, int dst_stride_u,
99  uint8* dst_v, int dst_stride_v,
100  int width, int height);
101 
102 // Convert ARGB To I420. (also in convert.h)
104 int ARGBToI420(const uint8* src_argb, int src_stride_argb,
105  uint8* dst_y, int dst_stride_y,
106  uint8* dst_u, int dst_stride_u,
107  uint8* dst_v, int dst_stride_v,
108  int width, int height);
109 
110 // Convert ARGB to J420. (JPeg full range I420).
112 int ARGBToJ420(const uint8* src_argb, int src_stride_argb,
113  uint8* dst_yj, int dst_stride_yj,
114  uint8* dst_u, int dst_stride_u,
115  uint8* dst_v, int dst_stride_v,
116  int width, int height);
117 
118 // Convert ARGB to J422.
120 int ARGBToJ422(const uint8* src_argb, int src_stride_argb,
121  uint8* dst_yj, int dst_stride_yj,
122  uint8* dst_u, int dst_stride_u,
123  uint8* dst_v, int dst_stride_v,
124  int width, int height);
125 
126 // Convert ARGB to J400. (JPeg full range).
128 int ARGBToJ400(const uint8* src_argb, int src_stride_argb,
129  uint8* dst_yj, int dst_stride_yj,
130  int width, int height);
131 
132 // Convert ARGB to I400.
134 int ARGBToI400(const uint8* src_argb, int src_stride_argb,
135  uint8* dst_y, int dst_stride_y,
136  int width, int height);
137 
138 // Convert ARGB to G. (Reverse of J400toARGB, which replicates G back to ARGB)
140 int ARGBToG(const uint8* src_argb, int src_stride_argb,
141  uint8* dst_g, int dst_stride_g,
142  int width, int height);
143 
144 // Convert ARGB To NV12.
146 int ARGBToNV12(const uint8* src_argb, int src_stride_argb,
147  uint8* dst_y, int dst_stride_y,
148  uint8* dst_uv, int dst_stride_uv,
149  int width, int height);
150 
151 // Convert ARGB To NV21.
153 int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
154  uint8* dst_y, int dst_stride_y,
155  uint8* dst_vu, int dst_stride_vu,
156  int width, int height);
157 
158 // Convert ARGB To NV21.
160 int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
161  uint8* dst_y, int dst_stride_y,
162  uint8* dst_vu, int dst_stride_vu,
163  int width, int height);
164 
165 // Convert ARGB To YUY2.
167 int ARGBToYUY2(const uint8* src_argb, int src_stride_argb,
168  uint8* dst_yuy2, int dst_stride_yuy2,
169  int width, int height);
170 
171 // Convert ARGB To UYVY.
173 int ARGBToUYVY(const uint8* src_argb, int src_stride_argb,
174  uint8* dst_uyvy, int dst_stride_uyvy,
175  int width, int height);
176 
177 #ifdef __cplusplus
178 } // extern "C"
179 } // namespace libyuv
180 #endif
181 
182 #endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
LIBYUV_API int ARGBToRGB24(const uint8 *src_argb, int src_stride_argb, uint8 *dst_rgb24, int dst_stride_rgb24, int width, int height)
Definition: convert_from_argb.cc:791
LIBYUV_API int ARGBToARGB1555(const uint8 *src_argb, int src_stride_argb, uint8 *dst_argb1555, int dst_stride_argb1555, int width, int height)
Definition: convert_from_argb.cc:1004
LIBYUV_API int ARGBToRGB565(const uint8 *src_argb, int src_stride_argb, uint8 *dst_rgb565, int dst_stride_rgb565, int width, int height)
Definition: convert_from_argb.cc:948
EGLSurface EGLint EGLint EGLint EGLint height
Definition: eglext.h:950
LIBYUV_API int ARGBToYUY2(const uint8 *src_argb, int src_stride_argb, uint8 *dst_yuy2, int dst_stride_yuy2, int width, int height)
Definition: convert_from_argb.cc:459
LIBYUV_API int ARGBToRGBA(const uint8 *src_argb, int src_stride_argb, uint8 *dst_rgba, int dst_stride_rgba, int width, int height)
Definition: convert_from_argb.cc:780
uint8_t * dst_v
Definition: peerconnection_jni.cc:2274
EGLSurface EGLint EGLint EGLint width
Definition: eglext.h:950
LIBYUV_API int ARGBCopy(const uint8 *src_argb, int src_stride_argb, uint8 *dst_argb, int dst_stride_argb, int width, int height)
Definition: convert_argb.cc:29
uint8_t * dst_y
Definition: peerconnection_jni.cc:2270
unsigned char uint8
Definition: basic_types.h:62
LIBYUV_API int ARGBToNV21(const uint8 *src_argb, int src_stride_argb, uint8 *dst_y, int dst_stride_y, uint8 *dst_vu, int dst_stride_vu, int width, int height)
Definition: convert_from_argb.cc:334
LIBYUV_API int ARGBToI444(const uint8 *src_argb, int src_stride_argb, uint8 *dst_y, int dst_stride_y, uint8 *dst_u, int dst_stride_u, uint8 *dst_v, int dst_stride_v, int width, int height)
Definition: convert_from_argb.cc:25
LIBYUV_API int ARGBToJ400(const uint8 *src_argb, int src_stride_argb, uint8 *dst_yj, int dst_stride_yj, int width, int height)
Definition: convert_from_argb.cc:1268
LIBYUV_API int ARGBToI420(const uint8 *src_argb, int src_stride_argb, uint8 *dst_y, int dst_stride_y, uint8 *dst_u, int dst_stride_u, uint8 *dst_v, int dst_stride_v, int width, int height)
Definition: convert.cc:478
LIBYUV_API int ARGBToG(const uint8 *src_argb, int src_stride_argb, uint8 *dst_g, int dst_stride_g, int width, int height)
LIBYUV_API int ARGBToNV12(const uint8 *src_argb, int src_stride_argb, uint8 *dst_y, int dst_stride_y, uint8 *dst_uv, int dst_stride_uv, int width, int height)
Definition: convert_from_argb.cc:209
LIBYUV_API int ARGBToI422(const uint8 *src_argb, int src_stride_argb, uint8 *dst_y, int dst_stride_y, uint8 *dst_u, int dst_stride_u, uint8 *dst_v, int dst_stride_v, int width, int height)
Definition: convert_from_argb.cc:114
LIBYUV_API int ARGBToI400(const uint8 *src_argb, int src_stride_argb, uint8 *dst_y, int dst_stride_y, int width, int height)
Definition: convert_from_argb.cc:711
LIBYUV_API int ARGBToRGB565Dither(const uint8 *src_argb, int src_stride_argb, uint8 *dst_rgb565, int dst_stride_rgb565, const uint8 *dither4x4, int width, int height)
Definition: convert_from_argb.cc:895
size_t dst_stride_v
Definition: peerconnection_jni.cc:2275
Definition: basictypes_test.cc:14
LIBYUV_API int ARGBToBGRA(const uint8 *src_argb, int src_stride_argb, uint8 *dst_bgra, int dst_stride_bgra, int width, int height)
Definition: convert_argb.cc:771
LIBYUV_API int ARGBToRAW(const uint8 *src_argb, int src_stride_argb, uint8 *dst_rgb, int dst_stride_rgb, int width, int height)
Definition: convert_from_argb.cc:839
#define LIBYUV_API
Definition: basic_types.h:102
size_t dst_stride_u
Definition: peerconnection_jni.cc:2273
uint8_t * dst_u
Definition: peerconnection_jni.cc:2272
LIBYUV_API int ARGBToJ420(const uint8 *src_argb, int src_stride_argb, uint8 *dst_yj, int dst_stride_yj, uint8 *dst_u, int dst_stride_u, uint8 *dst_v, int dst_stride_v, int width, int height)
Definition: convert_from_argb.cc:1116
size_t dst_stride_y
Definition: peerconnection_jni.cc:2271
LIBYUV_API int ARGBToUYVY(const uint8 *src_argb, int src_stride_argb, uint8 *dst_uyvy, int dst_stride_uyvy, int width, int height)
Definition: convert_from_argb.cc:585
LIBYUV_API int ARGBToJ422(const uint8 *src_argb, int src_stride_argb, uint8 *dst_yj, int dst_stride_yj, uint8 *dst_u, int dst_stride_u, uint8 *dst_v, int dst_stride_v, int width, int height)
Definition: convert_from_argb.cc:1190
LIBYUV_API int ARGBToABGR(const uint8 *src_argb, int src_stride_argb, uint8 *dst_abgr, int dst_stride_abgr, int width, int height)
Definition: convert_argb.cc:793
LIBYUV_API int ARGBToARGB4444(const uint8 *src_argb, int src_stride_argb, uint8 *dst_argb4444, int dst_stride_argb4444, int width, int height)
Definition: convert_from_argb.cc:1060