Chromium Code Reviews| Index: mojo/services/gfx/images/interfaces/image.mojom |
| diff --git a/mojo/services/gfx/images/interfaces/image.mojom b/mojo/services/gfx/images/interfaces/image.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..20ab8abfafe6c407c1d405d3e6d9a0fcd8d6eaef |
| --- /dev/null |
| +++ b/mojo/services/gfx/images/interfaces/image.mojom |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +module mojo.gfx; |
| + |
| +import "geometry/interfaces/geometry.mojom"; |
| + |
| +// This should probably be a system wide list (maybe in exists already?) since |
| +// this is undoubtably not the only interface that will care about color formats |
| +enum PixelLayout { |
| + BGRA_8888 = 0, |
| +}; |
| + |
| +enum ColorSpace { |
| + SRGB = 0, |
| +}; |
| + |
| +struct ColorFormat { |
| + PixelLayout layout; |
| + ColorSpace color_space; |
| +}; |
| + |
| +// ImageBuffer is a thin wrapper around a handle for a platform memory handle |
| +// which includes some basic metadata about the image. This may eventually be |
| +// provided by some other, more general purpose system This should probably be |
| +// where we put flags/properties about the buffer that are not image specific |
| +// (Like whether it is CPU or GPU memory, what the layout is like, etc.) |
| +struct ImageBuffer { |
| + uint64 size; |
| + handle data; |
| +}; |
| + |
| +// Image wraps ImageBuffer and provides image-specific metadata for the buffer |
| +struct Image { |
| + mojo.Size size; //width and height of image in pixels |
| + uint32 stride; //bytes per row |
| + uint32 pitch; // pixels per row |
| + ColorFormat format; //pixel format |
| + ImageBuffer buffer; |
| +}; |
| + |
| +struct SupportedImageProperties { |
|
jeffbrown
2016/03/03 23:09:58
move to image_pipe.mojom
jeffbrown
2016/03/03 23:10:40
On second thought, don't.
Forrest Reiling
2016/03/04 21:04:28
Acknowledged.
Forrest Reiling
2016/03/04 21:04:28
Acknowledged.
|
| + array<ColorFormat> formats; |
| + mojo.Size size; |
| +}; |