webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
convert_from.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 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_H_
12 #define INCLUDE_LIBYUV_CONVERT_FROM_H_
13 
14 #include "libyuv/basic_types.h"
15 #include "libyuv/rotate.h"
16 
17 #ifdef __cplusplus
18 namespace libyuv {
19 extern "C" {
20 #endif
21 
22 // See Also convert.h for conversions from formats to I420.
23 
24 // I420Copy in convert to I420ToI420.
25 
27 int I420ToI422(const uint8* src_y, int src_stride_y,
28  const uint8* src_u, int src_stride_u,
29  const uint8* src_v, int src_stride_v,
30  uint8* dst_y, int dst_stride_y,
31  uint8* dst_u, int dst_stride_u,
32  uint8* dst_v, int dst_stride_v,
33  int width, int height);
34 
36 int I420ToI444(const uint8* src_y, int src_stride_y,
37  const uint8* src_u, int src_stride_u,
38  const uint8* src_v, int src_stride_v,
39  uint8* dst_y, int dst_stride_y,
40  uint8* dst_u, int dst_stride_u,
41  uint8* dst_v, int dst_stride_v,
42  int width, int height);
43 
44 // Copy to I400. Source can be I420, I422, I444, I400, NV12 or NV21.
46 int I400Copy(const uint8* src_y, int src_stride_y,
47  uint8* dst_y, int dst_stride_y,
48  int width, int height);
49 
51 int I420ToNV12(const uint8* src_y, int src_stride_y,
52  const uint8* src_u, int src_stride_u,
53  const uint8* src_v, int src_stride_v,
54  uint8* dst_y, int dst_stride_y,
55  uint8* dst_uv, int dst_stride_uv,
56  int width, int height);
57 
59 int I420ToNV21(const uint8* src_y, int src_stride_y,
60  const uint8* src_u, int src_stride_u,
61  const uint8* src_v, int src_stride_v,
62  uint8* dst_y, int dst_stride_y,
63  uint8* dst_vu, int dst_stride_vu,
64  int width, int height);
65 
67 int I420ToYUY2(const uint8* src_y, int src_stride_y,
68  const uint8* src_u, int src_stride_u,
69  const uint8* src_v, int src_stride_v,
70  uint8* dst_frame, int dst_stride_frame,
71  int width, int height);
72 
74 int I420ToUYVY(const uint8* src_y, int src_stride_y,
75  const uint8* src_u, int src_stride_u,
76  const uint8* src_v, int src_stride_v,
77  uint8* dst_frame, int dst_stride_frame,
78  int width, int height);
79 
81 int I420ToARGB(const uint8* src_y, int src_stride_y,
82  const uint8* src_u, int src_stride_u,
83  const uint8* src_v, int src_stride_v,
84  uint8* dst_argb, int dst_stride_argb,
85  int width, int height);
86 
88 int I420ToBGRA(const uint8* src_y, int src_stride_y,
89  const uint8* src_u, int src_stride_u,
90  const uint8* src_v, int src_stride_v,
91  uint8* dst_argb, int dst_stride_argb,
92  int width, int height);
93 
95 int I420ToABGR(const uint8* src_y, int src_stride_y,
96  const uint8* src_u, int src_stride_u,
97  const uint8* src_v, int src_stride_v,
98  uint8* dst_argb, int dst_stride_argb,
99  int width, int height);
100 
102 int I420ToRGBA(const uint8* src_y, int src_stride_y,
103  const uint8* src_u, int src_stride_u,
104  const uint8* src_v, int src_stride_v,
105  uint8* dst_rgba, int dst_stride_rgba,
106  int width, int height);
107 
109 int I420ToRGB24(const uint8* src_y, int src_stride_y,
110  const uint8* src_u, int src_stride_u,
111  const uint8* src_v, int src_stride_v,
112  uint8* dst_frame, int dst_stride_frame,
113  int width, int height);
114 
116 int I420ToRAW(const uint8* src_y, int src_stride_y,
117  const uint8* src_u, int src_stride_u,
118  const uint8* src_v, int src_stride_v,
119  uint8* dst_frame, int dst_stride_frame,
120  int width, int height);
121 
123 int I420ToRGB565(const uint8* src_y, int src_stride_y,
124  const uint8* src_u, int src_stride_u,
125  const uint8* src_v, int src_stride_v,
126  uint8* dst_frame, int dst_stride_frame,
127  int width, int height);
128 
129 // Convert I420 To RGB565 with 4x4 dither matrix (16 bytes).
130 // Values in dither matrix from 0 to 7 recommended.
131 // The order of the dither matrix is first byte is upper left.
132 
134 int I420ToRGB565Dither(const uint8* src_y, int src_stride_y,
135  const uint8* src_u, int src_stride_u,
136  const uint8* src_v, int src_stride_v,
137  uint8* dst_frame, int dst_stride_frame,
138  const uint8* dither4x4, int width, int height);
139 
141 int I420ToARGB1555(const uint8* src_y, int src_stride_y,
142  const uint8* src_u, int src_stride_u,
143  const uint8* src_v, int src_stride_v,
144  uint8* dst_frame, int dst_stride_frame,
145  int width, int height);
146 
148 int I420ToARGB4444(const uint8* src_y, int src_stride_y,
149  const uint8* src_u, int src_stride_u,
150  const uint8* src_v, int src_stride_v,
151  uint8* dst_frame, int dst_stride_frame,
152  int width, int height);
153 
154 // Convert I420 to specified format.
155 // "dst_sample_stride" is bytes in a row for the destination. Pass 0 if the
156 // buffer has contiguous rows. Can be negative. A multiple of 16 is optimal.
158 int ConvertFromI420(const uint8* y, int y_stride,
159  const uint8* u, int u_stride,
160  const uint8* v, int v_stride,
161  uint8* dst_sample, int dst_sample_stride,
162  int width, int height,
163  uint32 format);
164 
165 #ifdef __cplusplus
166 } // extern "C"
167 } // namespace libyuv
168 #endif
169 
170 #endif // INCLUDE_LIBYUV_CONVERT_FROM_H_
EGLSurface EGLint EGLint EGLint EGLint height
Definition: eglext.h:950
uint8_t * dst_v
Definition: peerconnection_jni.cc:2274
GLint GLint GLint GLsizei GLsizei GLenum format
Definition: gl2.h:403
LIBYUV_API int I420ToABGR(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_argb, int dst_stride_argb, int width, int height)
Definition: convert_argb.cc:135
LIBYUV_API int I420ToRGB565(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_frame, int dst_stride_frame, int width, int height)
Definition: convert_from.cc:723
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:398
EGLSurface EGLint EGLint EGLint width
Definition: eglext.h:950
LIBYUV_API int ConvertFromI420(const uint8 *y, int y_stride, const uint8 *u, int u_stride, const uint8 *v, int v_stride, uint8 *dst_sample, int dst_sample_stride, int width, int height, uint32 format)
Definition: convert_from.cc:896
LIBYUV_API int I420ToNV21(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_y, int dst_stride_y, uint8 *dst_vu, int dst_stride_vu, int width, int height)
Definition: convert_from.cc:391
uint8_t * dst_y
Definition: peerconnection_jni.cc:2270
unsigned char uint8
Definition: basic_types.h:62
LIBYUV_API int I420ToARGB4444(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_frame, int dst_stride_frame, int width, int height)
Definition: convert_from.cc:661
LIBYUV_API int I420ToRGBA(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_rgba, int dst_stride_rgba, int width, int height)
Definition: convert_from.cc:477
LIBYUV_API int I420ToRGB565Dither(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_frame, int dst_stride_frame, const uint8 *dither4x4, int width, int height)
Definition: convert_from.cc:792
LIBYUV_API int I420ToYUY2(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_frame, int dst_stride_frame, int width, int height)
Definition: convert_from.cc:183
LIBYUV_API int I420ToUYVY(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_frame, int dst_stride_frame, int width, int height)
Definition: convert_from.cc:307
LIBYUV_API int I420ToRGB24(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_frame, int dst_stride_frame, int width, int height)
Definition: convert_from.cc:568
LIBYUV_API int I420ToARGB(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_argb, int dst_stride_argb, int width, int height)
Definition: convert_argb.cc:120
LIBYUV_API int I420ToBGRA(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_argb, int dst_stride_argb, int width, int height)
Definition: convert_from.cc:492
uint8_t * src_u
Definition: peerconnection_jni.cc:2263
LIBYUV_API int I420ToRAW(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_frame, int dst_stride_frame, int width, int height)
Definition: convert_from.cc:583
uint8_t * src_y
Definition: peerconnection_jni.cc:2261
EGLSurface EGLint EGLint y
Definition: eglext.h:950
LIBYUV_API int I420ToI444(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, 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.cc:88
const GLfloat * v
Definition: gl2.h:514
size_t dst_stride_v
Definition: peerconnection_jni.cc:2275
Definition: basictypes_test.cc:14
#define LIBYUV_API
Definition: basic_types.h:102
size_t dst_stride_u
Definition: peerconnection_jni.cc:2273
LIBYUV_API int I420ToNV12(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_y, int dst_stride_y, uint8 *dst_uv, int dst_stride_uv, int width, int height)
Definition: convert_from.cc:368
LIBYUV_API int I420ToARGB1555(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, uint8 *dst_frame, int dst_stride_frame, int width, int height)
Definition: convert_from.cc:598
uint8_t * dst_u
Definition: peerconnection_jni.cc:2272
uint32_t uint32
Definition: angle_config.h:28
LIBYUV_API int I420ToI422(const uint8 *src_y, int src_stride_y, const uint8 *src_u, int src_stride_u, const uint8 *src_v, int src_stride_v, 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.cc:66
size_t dst_stride_y
Definition: peerconnection_jni.cc:2271
uint8_t * src_v
Definition: peerconnection_jni.cc:2265
LIBYUV_API int I400Copy(const uint8 *src_y, int src_stride_y, uint8 *dst_y, int dst_stride_y, int width, int height)
Definition: convert_from.cc:109