| /* |
| * 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" |
| |
| // TODO(fbarchard): Remove the following headers includes |
| #include "libyuv/convert.h" |
| #include "libyuv/planar_functions.h" |
| |
| #ifdef __cplusplus |
| namespace libyuv { |
| extern "C" { |
| #endif |
| |
| void SetPlane(uint8* dst_y, int dst_stride_y, |
| int width, int height, |
| uint32 value); |
| |
| // Copy a plane of data (I420 to I400). |
| void CopyPlane(const uint8* src_y, int src_stride_y, |
| uint8* dst_y, int dst_stride_y, |
| 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 NV12 to ARGB. Also used for NV21. |
| int NV12ToARGB(const uint8* src_y, int src_stride_y, |
| const uint8* src_uv, int src_stride_uv, |
| uint8* dst_frame, int dst_stride_frame, |
| int width, int height); |
| |
| // Convert NV12 to RGB565. Also used for NV21. |
| int NV12ToRGB565(const uint8* src_y, int src_stride_y, |
| const uint8* src_uv, int src_stride_uv, |
| uint8* dst_frame, int dst_stride_frame, |
| int width, int height); |
| |
| // Convert YUY2 to ARGB. |
| int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2, |
| 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 RGB24 to ARGB. |
| int RGB24ToARGB(const uint8* src_bg24, int src_stride_bg24, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Deprecated function name. |
| #define BG24ToARGB RGB24ToARGB |
| |
| // 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 RGB24. |
| int ARGBToRGB24(const uint8* src_argb, int src_stride_argb, |
| uint8* dst_rgb24, int dst_stride_rgb24, |
| int width, int height); |
| |
| // Convert ARGB To RAW. |
| int ARGBToRAW(const uint8* src_argb, int src_stride_argb, |
| uint8* dst_rgb, int dst_stride_rgb, |
| 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); |
| |
| // Make a rectangle of ARGB gray scale. |
| int ARGBGray(uint8* dst_argb, int dst_stride_argb, |
| int x, int y, |
| int width, int height); |
| |
| // 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); |
| |
| typedef void (*ARGBBlendRow)(const uint8* src_argb0, |
| const uint8* src_argb1, |
| uint8* dst_argb, int width); |
| |
| // Get function to Alpha Blend ARGB pixels and store to destination. |
| ARGBBlendRow GetARGBBlend(uint8* dst_argb, int dst_stride_argb, int width); |
| |
| // Alpha Blend ARGB images and store to destination. |
| int ARGBBlend(const uint8* src_argb0, int src_stride_argb0, |
| const uint8* src_argb1, int src_stride_argb1, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Convert I422 to YUY2. |
| int I422ToYUY2(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); |
| |
| // Convert I422 to UYVY. |
| int I422ToUYVY(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); |
| |
| // Convert unattentuated ARGB to preattenuated ARGB. |
| int ARGBAttenuate(const uint8* src_argb, int src_stride_argb, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Convert preattentuated ARGB to unattenuated ARGB. |
| int ARGBUnattenuate(const uint8* src_argb, int src_stride_argb, |
| uint8* dst_argb, int dst_stride_argb, |
| int width, int height); |
| |
| // Get function to add or subtract rows of bytes to a 16 bit buffer. For blur. |
| typedef void (*AddRow)(const uint8* src, uint16* dst, int width); |
| AddRow GetAddRow(uint16* dst, int width); |
| AddRow GetSubRow(uint16* dst, int width); |
| |
| #ifdef __cplusplus |
| } // extern "C" |
| } // namespace libyuv |
| #endif |
| |
| #endif // INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ |