14984c3c95f18eda44492a2126c9958e447f2cca8msarett/*
24984c3c95f18eda44492a2126c9958e447f2cca8msarett * Copyright 2016 Google Inc.
34984c3c95f18eda44492a2126c9958e447f2cca8msarett *
44984c3c95f18eda44492a2126c9958e447f2cca8msarett * Use of this source code is governed by a BSD-style license that can be
54984c3c95f18eda44492a2126c9958e447f2cca8msarett * found in the LICENSE file.
64984c3c95f18eda44492a2126c9958e447f2cca8msarett */
74984c3c95f18eda44492a2126c9958e447f2cca8msarett
84984c3c95f18eda44492a2126c9958e447f2cca8msarett#ifndef SkYUVSizeInfo_DEFINED
94984c3c95f18eda44492a2126c9958e447f2cca8msarett#define SkYUVSizeInfo_DEFINED
104984c3c95f18eda44492a2126c9958e447f2cca8msarett
116b20a559968e1ed0d3aa4ecbd6ddda9e681b4f86Hal Canary#include "SkSize.h"
126b20a559968e1ed0d3aa4ecbd6ddda9e681b4f86Hal Canary
134984c3c95f18eda44492a2126c9958e447f2cca8msarettstruct SkYUVSizeInfo {
144984c3c95f18eda44492a2126c9958e447f2cca8msarett    enum {
154984c3c95f18eda44492a2126c9958e447f2cca8msarett        kY          = 0,
164984c3c95f18eda44492a2126c9958e447f2cca8msarett        kU          = 1,
174984c3c95f18eda44492a2126c9958e447f2cca8msarett        kV          = 2,
184984c3c95f18eda44492a2126c9958e447f2cca8msarett    };
194984c3c95f18eda44492a2126c9958e447f2cca8msarett    SkISize fSizes[3];
204984c3c95f18eda44492a2126c9958e447f2cca8msarett
214984c3c95f18eda44492a2126c9958e447f2cca8msarett    /**
224984c3c95f18eda44492a2126c9958e447f2cca8msarett     * While the widths of the Y, U, and V planes are not restricted, the
234984c3c95f18eda44492a2126c9958e447f2cca8msarett     * implementation often requires that the width of the memory allocated
244984c3c95f18eda44492a2126c9958e447f2cca8msarett     * for each plane be a multiple of 8.
254984c3c95f18eda44492a2126c9958e447f2cca8msarett     *
264984c3c95f18eda44492a2126c9958e447f2cca8msarett     * This struct allows us to inform the client how many "widthBytes"
274984c3c95f18eda44492a2126c9958e447f2cca8msarett     * that we need.  Note that we use the new idea of "widthBytes"
284984c3c95f18eda44492a2126c9958e447f2cca8msarett     * because this idea is distinct from "rowBytes" (used elsewhere in
294984c3c95f18eda44492a2126c9958e447f2cca8msarett     * Skia).  "rowBytes" allow the last row of the allocation to not
304984c3c95f18eda44492a2126c9958e447f2cca8msarett     * include any extra padding, while, in this case, every single row of
314984c3c95f18eda44492a2126c9958e447f2cca8msarett     * the allocation must be at least "widthBytes".
324984c3c95f18eda44492a2126c9958e447f2cca8msarett     */
334984c3c95f18eda44492a2126c9958e447f2cca8msarett    size_t fWidthBytes[3];
344984c3c95f18eda44492a2126c9958e447f2cca8msarett};
354984c3c95f18eda44492a2126c9958e447f2cca8msarett
364984c3c95f18eda44492a2126c9958e447f2cca8msarett#endif // SkYUVSizeInfo_DEFINED
37