blob: da7d3ead4950a6aa879bc2913f2a7b64676f29cf [file] [log] [blame]
// Copyright 2018 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.sysmem;
// TODO(https://fxbug.dev/42107169): change struct to table
/// Describes how an image is represented.
@available(added=7, deprecated=19)
type ImageFormat = struct {
/// Row width in pixels.
width uint32;
/// Number of rows.
height uint32;
/// Number of layers within a multi-layered image.
/// Defaults to 1 if not specified.
@allow_deprecated_struct_defaults
layers uint32 = 1;
/// Pixel format.
pixel_format PixelFormat;
/// Color space.
color_space ColorSpace;
planes array<ImagePlane, 4>;
};
@available(added=7, deprecated=19)
type ImagePlane = struct {
/// Byte offset of the start of the plane from the beginning of the image.
byte_offset uint32;
/// Stride in bytes per row.
/// Only meaningful for linear buffer formats.
bytes_per_row uint32;
};
/// Describes constraints for allocating images of some desired form.
// TODO(https://fxbug.dev/42107169): change struct to table
@available(added=7, deprecated=19)
type ImageSpec = struct {
/// Minimum width in pixels.
min_width uint32;
/// Minimum height in pixels.
min_height uint32;
/// Number of layers within a multi-layered image.
/// Defaults to 1 if not specified.
@allow_deprecated_struct_defaults
layers uint32 = 1;
/// Pixel format.
pixel_format PixelFormat;
/// Color space.
color_space ColorSpace;
// TODO(https://fxbug.dev/42107179): Add tiling formats.
};