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