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.
5 #ifndef MEDIA_BASE_YUV_CONVERT_H_
6 #define MEDIA_BASE_YUV_CONVERT_H_
8 #include "chromium_types.h"
15 // Type of YUV surface.
16 // The value of these enums matter as they are used to shift vertical indices.
18 YV12
= 0, // YV12 is half width and half height chroma channels.
19 YV16
= 1, // YV16 is half width and full height chroma channels.
20 YV24
= 2 // YV24 is full width and full height chroma channels.
23 // Mirror means flip the image horizontally, as in looking in a mirror.
24 // Rotate happens after mirroring.
26 ROTATE_0
, // Rotation off.
27 ROTATE_90
, // Rotate clockwise.
28 ROTATE_180
, // Rotate upside down.
29 ROTATE_270
, // Rotate counter clockwise.
30 MIRROR_ROTATE_0
, // Mirror horizontally.
31 MIRROR_ROTATE_90
, // Mirror then Rotate clockwise.
32 MIRROR_ROTATE_180
, // Mirror vertically.
33 MIRROR_ROTATE_270
// Transpose.
36 // Filter affects how scaling looks.
38 FILTER_NONE
= 0, // No filter (point sampled).
39 FILTER_BILINEAR_H
= 1, // Bilinear horizontal filter.
40 FILTER_BILINEAR_V
= 2, // Bilinear vertical filter.
41 FILTER_BILINEAR
= 3 // Bilinear filter.
44 NS_GFX_(YUVType
) TypeFromSize(int ywidth
, int yheight
, int cbcrwidth
, int cbcrheight
);
46 // Convert a frame of YUV to 32 bit ARGB.
47 // Pass in YV16/YV12 depending on source format
48 NS_GFX_(void) ConvertYCbCrToRGB32(const uint8
* yplane
,
61 // Scale a frame of YUV to 32 bit ARGB.
62 // Supports rotation and mirroring.
63 NS_GFX_(void) ScaleYCbCrToRGB32(const uint8
* yplane
,
79 } // namespace mozilla
81 #endif // MEDIA_BASE_YUV_CONVERT_H_