]> granicus.if.org Git - libvpx/blob - third_party/libyuv/include/libyuv/convert_from_argb.h
c592fc2353e47687ef9d06ea0f93defb30353c53
[libvpx] / third_party / libyuv / include / libyuv / convert_from_argb.h
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_  // NOLINT
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
23 LIBYUV_API
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.
29 LIBYUV_API
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.
35 LIBYUV_API
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.
41 LIBYUV_API
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.
47 LIBYUV_API
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.
53 LIBYUV_API
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.
59 LIBYUV_API
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 8x8 dither matrix (64 bytes).
65 // Values in dither matrix from 0 to 255.  128 is best for no dither.
66 LIBYUV_API
67 int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb,
68                        uint8* dst_rgb565, int dst_stride_rgb565,
69                        const uint8* dither8x8, int width, int height);
70
71 // Convert ARGB To ARGB1555.
72 LIBYUV_API
73 int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb,
74                    uint8* dst_argb1555, int dst_stride_argb1555,
75                    int width, int height);
76
77 // Convert ARGB To ARGB4444.
78 LIBYUV_API
79 int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb,
80                    uint8* dst_argb4444, int dst_stride_argb4444,
81                    int width, int height);
82
83 // Convert ARGB To I444.
84 LIBYUV_API
85 int ARGBToI444(const uint8* src_argb, int src_stride_argb,
86                uint8* dst_y, int dst_stride_y,
87                uint8* dst_u, int dst_stride_u,
88                uint8* dst_v, int dst_stride_v,
89                int width, int height);
90
91 // Convert ARGB To I422.
92 LIBYUV_API
93 int ARGBToI422(const uint8* src_argb, int src_stride_argb,
94                uint8* dst_y, int dst_stride_y,
95                uint8* dst_u, int dst_stride_u,
96                uint8* dst_v, int dst_stride_v,
97                int width, int height);
98
99 // Convert ARGB To I420. (also in convert.h)
100 LIBYUV_API
101 int ARGBToI420(const uint8* src_argb, int src_stride_argb,
102                uint8* dst_y, int dst_stride_y,
103                uint8* dst_u, int dst_stride_u,
104                uint8* dst_v, int dst_stride_v,
105                int width, int height);
106
107 // Convert ARGB to J420. (JPeg full range I420).
108 LIBYUV_API
109 int ARGBToJ420(const uint8* src_argb, int src_stride_argb,
110                uint8* dst_yj, int dst_stride_yj,
111                uint8* dst_u, int dst_stride_u,
112                uint8* dst_v, int dst_stride_v,
113                int width, int height);
114
115 // Convert ARGB to J422.
116 LIBYUV_API
117 int ARGBToJ422(const uint8* src_argb, int src_stride_argb,
118                uint8* dst_yj, int dst_stride_yj,
119                uint8* dst_u, int dst_stride_u,
120                uint8* dst_v, int dst_stride_v,
121                int width, int height);
122
123 // Convert ARGB To I411.
124 LIBYUV_API
125 int ARGBToI411(const uint8* src_argb, int src_stride_argb,
126                uint8* dst_y, int dst_stride_y,
127                uint8* dst_u, int dst_stride_u,
128                uint8* dst_v, int dst_stride_v,
129                int width, int height);
130
131 // Convert ARGB to J400. (JPeg full range).
132 LIBYUV_API
133 int ARGBToJ400(const uint8* src_argb, int src_stride_argb,
134                uint8* dst_yj, int dst_stride_yj,
135                int width, int height);
136
137 // Convert ARGB to I400.
138 LIBYUV_API
139 int ARGBToI400(const uint8* src_argb, int src_stride_argb,
140                uint8* dst_y, int dst_stride_y,
141                int width, int height);
142
143 // Convert ARGB To NV12.
144 LIBYUV_API
145 int ARGBToNV12(const uint8* src_argb, int src_stride_argb,
146                uint8* dst_y, int dst_stride_y,
147                uint8* dst_uv, int dst_stride_uv,
148                int width, int height);
149
150 // Convert ARGB To NV21.
151 LIBYUV_API
152 int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
153                uint8* dst_y, int dst_stride_y,
154                uint8* dst_vu, int dst_stride_vu,
155                int width, int height);
156
157 // Convert ARGB To NV21.
158 LIBYUV_API
159 int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
160                uint8* dst_y, int dst_stride_y,
161                uint8* dst_vu, int dst_stride_vu,
162                int width, int height);
163
164 // Convert ARGB To YUY2.
165 LIBYUV_API
166 int ARGBToYUY2(const uint8* src_argb, int src_stride_argb,
167                uint8* dst_yuy2, int dst_stride_yuy2,
168                int width, int height);
169
170 // Convert ARGB To UYVY.
171 LIBYUV_API
172 int ARGBToUYVY(const uint8* src_argb, int src_stride_argb,
173                uint8* dst_uyvy, int dst_stride_uyvy,
174                int width, int height);
175
176 #ifdef __cplusplus
177 }  // extern "C"
178 }  // namespace libyuv
179 #endif
180
181 #endif  // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_  NOLINT