| // Copyright 2023 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.images2; |
| |
| // TODO(b/329151498): Remove this file when build-time support for level 17 and |
| // lower is removed. |
| |
| // |
| /// An integral, rectangular, axis-aligned region in a 2D cartesian |
| /// space, with unsigned location and distance fields. |
| /// |
| /// This type does not specify units. Protocols that use this type should |
| /// specify the characteristics of the vector space, including orientation and |
| /// units. |
| // |
| // Some non-protocol types in this library are used by libmagma, which ships in |
| // the IDK and must be built at all API levels supported by the IDK. See |
| // https://fxbug.dev/42085119. ImageFormat is one of those types and relies on |
| // fuchsia.math.RectU which is only available at 18. For earlier API levels, |
| // use this definition (same as the RectU that existed before |
| // https://fxrev.dev/796842). |
| @available(added=12, removed=18, legacy=true) |
| type RectU = struct { |
| /// The location of the origin of the rectangle in the x-axis. |
| x uint32; |
| |
| /// The location of the origin of the rectangle in the y-axis. |
| y uint32; |
| |
| /// The distance along the x-axis. |
| /// |
| /// The region includes x values starting at `x` and increasing along the |
| /// x-axis. |
| width uint32; |
| |
| /// The distance along the y-axis. |
| /// |
| /// The region includes y values starting at `y` and increasing along the |
| /// y-axis. |
| height uint32; |
| }; |