OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 module mojo.gfx; | |
6 | |
7 import "geometry/interfaces/geometry.mojom"; | |
8 | |
9 // This should probably be a system wide list (maybe in exists already?) since | |
10 // this is undoubtably not the only interface that will care about color formats | |
11 enum PixelLayout { | |
12 BGRA_8888 = 0, | |
13 }; | |
14 | |
15 enum ColorSpace { | |
16 SRGB = 0, | |
17 }; | |
18 | |
19 struct ColorFormat { | |
20 PixelLayout layout; | |
21 ColorSpace color_space; | |
22 }; | |
23 | |
24 // ImageBuffer is a thin wrapper around a handle for a platform memory handle | |
25 // which includes some basic metadata about the image. This may eventually be | |
26 // provided by some other, more general purpose system This should probably be | |
27 // where we put flags/properties about the buffer that are not image specific | |
28 // (Like whether it is CPU or GPU memory, what the layout is like, etc.) | |
29 struct ImageBuffer { | |
30 uint64 size; | |
31 handle data; | |
32 }; | |
33 | |
34 // Image wraps ImageBuffer and provides image-specific metadata for the buffer | |
35 struct Image { | |
36 mojo.Size size; //width and height of image in pixels | |
37 uint32 stride; //bytes per row | |
38 uint32 pitch; // pixels per row | |
39 ColorFormat format; //pixel format | |
40 ImageBuffer buffer; | |
41 }; | |
42 | |
43 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.
| |
44 array<ColorFormat> formats; | |
45 mojo.Size size; | |
46 }; | |
OLD | NEW |