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"
12 #define HAVE_YCBCR_TO_RGB565 1
19 // Type of YUV surface.
20 // The value of these enums matter as they are used to shift vertical indices.
22 YV12
= 0, // YV12 is half width and half height chroma channels.
23 YV16
= 1, // YV16 is half width and full height chroma channels.
24 YV24
= 2 // YV24 is full width and full height chroma channels.
27 // Mirror means flip the image horizontally, as in looking in a mirror.
28 // Rotate happens after mirroring.
30 ROTATE_0
, // Rotation off.
31 ROTATE_90
, // Rotate clockwise.
32 ROTATE_180
, // Rotate upside down.
33 ROTATE_270
, // Rotate counter clockwise.
34 MIRROR_ROTATE_0
, // Mirror horizontally.
35 MIRROR_ROTATE_90
, // Mirror then Rotate clockwise.
36 MIRROR_ROTATE_180
, // Mirror vertically.
37 MIRROR_ROTATE_270
// Transpose.
40 // Filter affects how scaling looks.
42 FILTER_NONE
= 0, // No filter (point sampled).
43 FILTER_BILINEAR_H
= 1, // Bilinear horizontal filter.
44 FILTER_BILINEAR_V
= 2, // Bilinear vertical filter.
45 FILTER_BILINEAR
= 3 // Bilinear filter.
48 // Convert a frame of YUV to 16 bit RGB565.
49 // Pass in YV12 formats
50 NS_GFX_(void) ConvertYCbCrToRGB565(const uint8
* yplane
,
63 // Convert a frame of YUV to 32 bit ARGB.
64 // Pass in YV16/YV12 depending on source format
65 NS_GFX_(void) ConvertYCbCrToRGB32(const uint8
* yplane
,
78 // Scale a frame of YUV to 32 bit ARGB.
79 // Supports rotation and mirroring.
80 NS_GFX_(void) ScaleYCbCrToRGB32(const uint8
* yplane
,
96 } // namespace mozilla
98 #endif // MEDIA_BASE_YUV_CONVERT_H_