| /* |
| * Copyright (c) 2011 The LibYuv project authors. All Rights Reserved. |
| * |
| * Use of this source code is governed by a BSD-style license |
| * that can be found in the LICENSE file in the root of the source |
| * tree. An additional intellectual property rights grant can be found |
| * in the file PATENTS. All contributing project authors may |
| * be found in the AUTHORS file in the root of the source tree. |
| */ |
| |
| #ifndef INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ |
| #define INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ |
| |
| #include "libyuv/basic_types.h" |
| |
| #ifdef __cplusplus |
| namespace libyuv { |
| extern "C" { |
| #endif |
| |
| // Copy I420 to I420. |
| int I420Copy(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); |
| |
| // I420 mirror |
| int I420Mirror(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); |
| |
| // Convert I422 to I420. |
| int I422ToI420(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); |
| |
| // Convert I422 to I420. |
| 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); |
| |
| // Convert I444 to I420. |
| int I444ToI420(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); |
| |
| // Convert I420 to I444. |
| 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); |
| |
| // Convert I400 (grey) to I420. |
| int I400ToI420(const uint8* src_y, int src_stride_y, |
| 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); |
| |
| // Copy to I400. Source can be I420,422,444,400,NV12,NV21 |
| int I400Copy(const uint8* src_y, int src_stride_y, |
| uint8* dst_y, int dst_stride_y, |
| int width, int height); |
| |
| // Convert NV12 to I420. Also used for NV21. |
| int NV12ToI420(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 width, int height); |
| |
| // Convert Q420 to I420. |
| int Q420ToI420(const uint8* src_y, int src_stride_y, |
| const uint8* src_yuy2, int src_stride_yuy2, |
| 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); |
| |
| // Convert M420 to I420. |
| int M420ToI420(const uint8* src_m420, int src_stride_m420, |
| 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); |
| |
| // Convert YUY2 to I420. |
| int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2, |
| 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); |
| |
| // Convert UYVY to I420. |
| int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy, |
| 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); |
| |
| // Convert I420 to ARGB. |
| 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); |
| |
| // Convert I420 to BGRA. |
| 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); |
| |
| // Convert I420 to ABGR. |
| 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); |
| |
| // Convert I422 to ARGB. |
| int I422ToARGB(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); |
| |
| // Convert I444 to ARGB. |
| int I444ToARGB(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); |
| |
| // Convert I400 to ARGB. |
| int I400ToARGB(const uint8* src_y, int src_stride_y, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Convert I400 to ARGB. Reverse of ARGBToI400 |
| int I400ToARGB_Reference(const uint8* src_y, int src_stride_y, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Convert RAW to ARGB. |
| int RAWToARGB(const uint8* src_raw, int src_stride_raw, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Convert BG24 to ARGB. |
| int BG24ToARGB(const uint8* src_bg24, int src_stride_bg24, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Convert ABGR to ARGB. Also used for ARGB to ABGR. |
| int ABGRToARGB(const uint8* src_abgr, int src_stride_abgr, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Convert BGRA to ARGB. Also used for ARGB to BGRA. |
| int BGRAToARGB(const uint8* src_bgra, int src_stride_bgra, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Convert ARGB to I400. |
| int ARGBToI400(const uint8* src_argb, int src_stride_argb, |
| uint8* dst_y, int dst_stride_y, |
| int width, int height); |
| |
| // Draw a rectangle into I420 |
| int I420Rect(uint8* dst_y, int dst_stride_y, |
| uint8* dst_u, int dst_stride_u, |
| uint8* dst_v, int dst_stride_v, |
| int x, int y, |
| int width, int height, |
| int value_y, int value_u, int value_v); |
| |
| // Draw a rectangle into ARGB |
| int ARGBRect(uint8* dst_argb, int dst_stride_argb, |
| int x, int y, |
| int width, int height, |
| uint32 value); |
| |
| // Copy ARGB to ARGB. |
| int ARGBCopy(const uint8* src_argb, int src_stride_argb, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Copy a plane of data |
| void CopyPlane(const uint8* src_y, int src_stride_y, |
| uint8* dst_y, int dst_stride_y, |
| int width, int height); |
| |
| #ifdef __cplusplus |
| } // extern "C" |
| } // namespace libyuv |
| #endif |
| |
| #endif // INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ |