blob: 14c1c5466d318ff1e3264327e9ee4fccab916d2c [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(fxbug.dev/32119): change struct to table
/// Describes how an image is represented.
@for_deprecated_c_bindings
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>;
};
@for_deprecated_c_bindings
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(fxbug.dev/32119): change struct to table
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(fxbug.dev/32128): Add tiling formats.
};