webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
rotate.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_ROTATE_H_
12 #define INCLUDE_LIBYUV_ROTATE_H_
13 
14 #include "libyuv/basic_types.h"
15 
16 #ifdef __cplusplus
17 namespace libyuv {
18 extern "C" {
19 #endif
20 
21 // Supported rotation.
22 typedef enum RotationMode {
23  kRotate0 = 0, // No rotation.
24  kRotate90 = 90, // Rotate 90 degrees clockwise.
25  kRotate180 = 180, // Rotate 180 degrees.
26  kRotate270 = 270, // Rotate 270 degrees clockwise.
27 
28  // Deprecated.
33 
34 // Rotate I420 frame.
36 int I420Rotate(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 src_width, int src_height, enum RotationMode mode);
43 
44 // Rotate NV12 input and store in I420.
46 int NV12ToI420Rotate(const uint8* src_y, int src_stride_y,
47  const uint8* src_uv, int src_stride_uv,
48  uint8* dst_y, int dst_stride_y,
49  uint8* dst_u, int dst_stride_u,
50  uint8* dst_v, int dst_stride_v,
51  int src_width, int src_height, enum RotationMode mode);
52 
53 // Rotate a plane by 0, 90, 180, or 270.
55 int RotatePlane(const uint8* src, int src_stride,
56  uint8* dst, int dst_stride,
57  int src_width, int src_height, enum RotationMode mode);
58 
59 // Rotate planes by 90, 180, 270. Deprecated.
61 void RotatePlane90(const uint8* src, int src_stride,
62  uint8* dst, int dst_stride,
63  int width, int height);
64 
66 void RotatePlane180(const uint8* src, int src_stride,
67  uint8* dst, int dst_stride,
68  int width, int height);
69 
71 void RotatePlane270(const uint8* src, int src_stride,
72  uint8* dst, int dst_stride,
73  int width, int height);
74 
76 void RotateUV90(const uint8* src, int src_stride,
77  uint8* dst_a, int dst_stride_a,
78  uint8* dst_b, int dst_stride_b,
79  int width, int height);
80 
81 // Rotations for when U and V are interleaved.
82 // These functions take one input pointer and
83 // split the data into two buffers while
84 // rotating them. Deprecated.
86 void RotateUV180(const uint8* src, int src_stride,
87  uint8* dst_a, int dst_stride_a,
88  uint8* dst_b, int dst_stride_b,
89  int width, int height);
90 
92 void RotateUV270(const uint8* src, int src_stride,
93  uint8* dst_a, int dst_stride_a,
94  uint8* dst_b, int dst_stride_b,
95  int width, int height);
96 
97 // The 90 and 270 functions are based on transposes.
98 // Doing a transpose with reversing the read/write
99 // order will result in a rotation by +- 90 degrees.
100 // Deprecated.
102 void TransposePlane(const uint8* src, int src_stride,
103  uint8* dst, int dst_stride,
104  int width, int height);
105 
107 void TransposeUV(const uint8* src, int src_stride,
108  uint8* dst_a, int dst_stride_a,
109  uint8* dst_b, int dst_stride_b,
110  int width, int height);
111 
112 #ifdef __cplusplus
113 } // extern "C"
114 } // namespace libyuv
115 #endif
116 
117 #endif // INCLUDE_LIBYUV_ROTATE_H_
LIBYUV_API void RotateUV270(const uint8 *src, int src_stride, uint8 *dst_a, int dst_stride_a, uint8 *dst_b, int dst_stride_b, int width, int height)
Definition: rotate.cc:256
LIBYUV_API int NV12ToI420Rotate(const uint8 *src_y, int src_stride_y, const uint8 *src_uv, int src_stride_uv, uint8 *dst_y, int dst_stride_y, uint8 *dst_u, int dst_stride_u, uint8 *dst_v, int dst_stride_v, int src_width, int src_height, enum RotationMode mode)
Definition: rotate.cc:430
enum RotationMode RotationModeEnum
EGLSurface EGLint EGLint EGLint EGLint height
Definition: eglext.h:950
uint8_t * dst_v
Definition: peerconnection_jni.cc:2274
LIBYUV_API void RotatePlane270(const uint8 *src, int src_stride, uint8 *dst, int dst_stride, int width, int height)
Definition: rotate.cc:89
jobject jint jint jint jobject jint dst_stride
Definition: peerconnection_jni.cc:2184
EGLSurface EGLint EGLint EGLint width
Definition: eglext.h:950
LIBYUV_API int I420Rotate(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 src_width, int src_height, enum RotationMode mode)
Definition: rotate.cc:353
LIBYUV_API void RotateUV180(const uint8 *src, int src_stride, uint8 *dst_a, int dst_stride_a, uint8 *dst_b, int dst_stride_b, int width, int height)
Definition: rotate.cc:273
uint8_t * dst_y
Definition: peerconnection_jni.cc:2270
Definition: rotate.h:31
unsigned char uint8
Definition: basic_types.h:62
GLenum mode
Definition: gl2.h:461
GLenum GLenum dst
Definition: gl2ext.h:304
Definition: rotate.h:29
Definition: rotate.h:24
uint8_t * src_u
Definition: peerconnection_jni.cc:2263
LIBYUV_API int RotatePlane(const uint8 *src, int src_stride, uint8 *dst, int dst_stride, int src_width, int src_height, enum RotationMode mode)
Definition: rotate.cc:309
Definition: rotate.h:23
uint8_t * src_y
Definition: peerconnection_jni.cc:2261
LIBYUV_API void RotateUV90(const uint8 *src, int src_stride, uint8 *dst_a, int dst_stride_a, uint8 *dst_b, int dst_stride_b, int width, int height)
Definition: rotate.cc:242
LIBYUV_API void TransposeUV(const uint8 *src, int src_stride, uint8 *dst_a, int dst_stride_a, uint8 *dst_b, int dst_stride_b, int width, int height)
Definition: rotate.cc:192
GLenum src
Definition: gl2ext.h:304
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
uint8_t * dst_u
Definition: peerconnection_jni.cc:2272
size_t dst_stride_y
Definition: peerconnection_jni.cc:2271
LIBYUV_API void RotatePlane90(const uint8 *src, int src_stride, uint8 *dst, int dst_stride, int width, int height)
Definition: rotate.cc:77
uint8_t * src_v
Definition: peerconnection_jni.cc:2265
LIBYUV_API void TransposePlane(const uint8 *src, int src_stride, uint8 *dst, int dst_stride, int width, int height)
Definition: rotate.cc:25
Definition: rotate.h:26
Definition: rotate.h:25
Definition: rotate.h:30
RotationMode
Definition: rotate.h:22
jobject jint jint jint src_stride
Definition: peerconnection_jni.cc:2183
LIBYUV_API void RotatePlane180(const uint8 *src, int src_stride, uint8 *dst, int dst_stride, int width, int height)
Definition: rotate.cc:101