• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkYUVSizeInfo_DEFINED
9 #define SkYUVSizeInfo_DEFINED
10 
11 #include "SkSize.h"
12 
13 struct SkYUVSizeInfo {
14     enum {
15         kY          = 0,
16         kU          = 1,
17         kV          = 2,
18     };
19     SkISize fSizes[3];
20 
21     /**
22      * While the widths of the Y, U, and V planes are not restricted, the
23      * implementation often requires that the width of the memory allocated
24      * for each plane be a multiple of 8.
25      *
26      * This struct allows us to inform the client how many "widthBytes"
27      * that we need.  Note that we use the new idea of "widthBytes"
28      * because this idea is distinct from "rowBytes" (used elsewhere in
29      * Skia).  "rowBytes" allow the last row of the allocation to not
30      * include any extra padding, while, in this case, every single row of
31      * the allocation must be at least "widthBytes".
32      */
33     size_t fWidthBytes[3];
34 };
35 
36 #endif // SkYUVSizeInfo_DEFINED
37