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_ // NOLINT 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 26 LIBYUV_API 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 35 LIBYUV_API 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 LIBYUV_API 45 int I420ToI411(const uint8* src_y, int src_stride_y, 46 const uint8* src_u, int src_stride_u, 47 const uint8* src_v, int src_stride_v, 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 width, int height); 52 53 // Copy to I400. Source can be I420, I422, I444, I400, NV12 or NV21. 54 LIBYUV_API 55 int I400Copy(const uint8* src_y, int src_stride_y, 56 uint8* dst_y, int dst_stride_y, 57 int width, int height); 58 59 // TODO(fbarchard): I420ToNV12 60 // TODO(fbarchard): I420ToM420 61 // TODO(fbarchard): I420ToQ420 62 63 LIBYUV_API 64 int I420ToYUY2(const uint8* src_y, int src_stride_y, 65 const uint8* src_u, int src_stride_u, 66 const uint8* src_v, int src_stride_v, 67 uint8* dst_frame, int dst_stride_frame, 68 int width, int height); 69 70 LIBYUV_API 71 int I420ToUYVY(const uint8* src_y, int src_stride_y, 72 const uint8* src_u, int src_stride_u, 73 const uint8* src_v, int src_stride_v, 74 uint8* dst_frame, int dst_stride_frame, 75 int width, int height); 76 77 LIBYUV_API 78 int I420ToV210(const uint8* src_y, int src_stride_y, 79 const uint8* src_u, int src_stride_u, 80 const uint8* src_v, int src_stride_v, 81 uint8* dst_frame, int dst_stride_frame, 82 int width, int height); 83 84 LIBYUV_API 85 int I420ToARGB(const uint8* src_y, int src_stride_y, 86 const uint8* src_u, int src_stride_u, 87 const uint8* src_v, int src_stride_v, 88 uint8* dst_argb, int dst_stride_argb, 89 int width, int height); 90 91 LIBYUV_API 92 int I420ToBGRA(const uint8* src_y, int src_stride_y, 93 const uint8* src_u, int src_stride_u, 94 const uint8* src_v, int src_stride_v, 95 uint8* dst_argb, int dst_stride_argb, 96 int width, int height); 97 98 LIBYUV_API 99 int I420ToABGR(const uint8* src_y, int src_stride_y, 100 const uint8* src_u, int src_stride_u, 101 const uint8* src_v, int src_stride_v, 102 uint8* dst_argb, int dst_stride_argb, 103 int width, int height); 104 105 LIBYUV_API 106 int I420ToRGBA(const uint8* src_y, int src_stride_y, 107 const uint8* src_u, int src_stride_u, 108 const uint8* src_v, int src_stride_v, 109 uint8* dst_rgba, int dst_stride_rgba, 110 int width, int height); 111 112 LIBYUV_API 113 int I420ToRGB24(const uint8* src_y, int src_stride_y, 114 const uint8* src_u, int src_stride_u, 115 const uint8* src_v, int src_stride_v, 116 uint8* dst_frame, int dst_stride_frame, 117 int width, int height); 118 119 LIBYUV_API 120 int I420ToRAW(const uint8* src_y, int src_stride_y, 121 const uint8* src_u, int src_stride_u, 122 const uint8* src_v, int src_stride_v, 123 uint8* dst_frame, int dst_stride_frame, 124 int width, int height); 125 126 LIBYUV_API 127 int I420ToRGB565(const uint8* src_y, int src_stride_y, 128 const uint8* src_u, int src_stride_u, 129 const uint8* src_v, int src_stride_v, 130 uint8* dst_frame, int dst_stride_frame, 131 int width, int height); 132 133 LIBYUV_API 134 int I420ToARGB1555(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 int width, int height); 139 140 LIBYUV_API 141 int I420ToARGB4444(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 147 // Note Bayer formats (BGGR) To I420 are in format_conversion.h. 148 149 // Convert I420 to specified format. 150 // "dst_sample_stride" is bytes in a row for the destination. Pass 0 if the 151 // buffer has contiguous rows. Can be negative. A multiple of 16 is optimal. 152 LIBYUV_API 153 int ConvertFromI420(const uint8* y, int y_stride, 154 const uint8* u, int u_stride, 155 const uint8* v, int v_stride, 156 uint8* dst_sample, int dst_sample_stride, 157 int width, int height, 158 uint32 format); 159 160 #ifdef __cplusplus 161 } // extern "C" 162 } // namespace libyuv 163 #endif 164 165 #endif // INCLUDE_LIBYUV_CONVERT_FROM_H_ NOLINT 166