1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #ifndef MEDIA_BASE_YUV_CONVERT_H_
8 #define MEDIA_BASE_YUV_CONVERT_H_
10 #include "chromium_types.h"
11 #include "mozilla/gfx/Types.h"
17 // Type of YUV surface.
18 // The value of these enums matter as they are used to shift vertical indices.
20 YV12
= 0, // YV12 is half width and half height chroma channels.
21 YV16
= 1, // YV16 is half width and full height chroma channels.
22 YV24
= 2, // YV24 is full width and full height chroma channels.
23 Y8
= 3 // Y8 is monochrome: no chroma channels.
26 // Mirror means flip the image horizontally, as in looking in a mirror.
27 // Rotate happens after mirroring.
29 ROTATE_0
, // Rotation off.
30 ROTATE_90
, // Rotate clockwise.
31 ROTATE_180
, // Rotate upside down.
32 ROTATE_270
, // Rotate counter clockwise.
33 MIRROR_ROTATE_0
, // Mirror horizontally.
34 MIRROR_ROTATE_90
, // Mirror then Rotate clockwise.
35 MIRROR_ROTATE_180
, // Mirror vertically.
36 MIRROR_ROTATE_270
// Transpose.
39 // Filter affects how scaling looks.
41 FILTER_NONE
= 0, // No filter (point sampled).
42 FILTER_BILINEAR_H
= 1, // Bilinear horizontal filter.
43 FILTER_BILINEAR_V
= 2, // Bilinear vertical filter.
44 FILTER_BILINEAR
= 3 // Bilinear filter.
47 // Convert a frame of YUV to 32 bit ARGB.
48 // Pass in YV16/YV12 depending on source format
49 void ConvertYCbCrToRGB32(const uint8_t* yplane
,
50 const uint8_t* uplane
,
51 const uint8_t* vplane
,
61 YUVColorSpace yuv_color_space
,
62 ColorRange color_range
);
64 void ConvertYCbCrToRGB32_deprecated(const uint8_t* yplane
,
65 const uint8_t* uplane
,
66 const uint8_t* vplane
,
77 // Scale a frame of YUV to 32 bit ARGB.
78 // Supports rotation and mirroring.
79 void ScaleYCbCrToRGB32(const uint8_t* yplane
,
80 const uint8_t* uplane
,
81 const uint8_t* vplane
,
91 YUVColorSpace yuv_color_space
,
94 void ScaleYCbCrToRGB32_deprecated(const uint8_t* yplane
,
95 const uint8_t* uplane
,
96 const uint8_t* vplane
,
109 void ConvertI420AlphaToARGB32(const uint8_t* yplane
,
110 const uint8_t* uplane
,
111 const uint8_t* vplane
,
112 const uint8_t* aplane
,
121 } // namespace mozilla
123 #endif // MEDIA_BASE_YUV_CONVERT_H_