OLD | NEW |
1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 #ifndef PPAPI_C_PPB_IMAGE_DATA_H_ | 5 #ifndef PPAPI_C_PPB_IMAGE_DATA_H_ |
6 #define PPAPI_C_PPB_IMAGE_DATA_H_ | 6 #define PPAPI_C_PPB_IMAGE_DATA_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_macros.h" | 10 #include "ppapi/c/pp_macros.h" |
11 #include "ppapi/c/pp_module.h" | 11 #include "ppapi/c/pp_module.h" |
12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
13 #include "ppapi/c/pp_size.h" | 13 #include "ppapi/c/pp_size.h" |
14 #include "ppapi/c/pp_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
15 | 15 |
| 16 /** |
| 17 * @file |
| 18 * Defines the API ... |
| 19 */ |
| 20 |
| 21 /** |
| 22 * @addtogroup Enums |
| 23 * @{ |
| 24 */ |
| 25 |
16 typedef enum { | 26 typedef enum { |
17 PP_IMAGEDATAFORMAT_BGRA_PREMUL, | 27 PP_IMAGEDATAFORMAT_BGRA_PREMUL, |
18 PP_IMAGEDATAFORMAT_RGBA_PREMUL | 28 PP_IMAGEDATAFORMAT_RGBA_PREMUL |
19 } PP_ImageDataFormat; | 29 } PP_ImageDataFormat; |
20 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ImageDataFormat, 4); | 30 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ImageDataFormat, 4); |
| 31 /** |
| 32 * @} |
| 33 */ |
21 | 34 |
| 35 /** |
| 36 * @addtogroup Structs |
| 37 * @{ |
| 38 */ |
22 struct PP_ImageDataDesc { | 39 struct PP_ImageDataDesc { |
23 PP_ImageDataFormat format; | 40 PP_ImageDataFormat format; |
24 | 41 |
25 /** Size of the bitmap in pixels. */ | 42 /** Size of the bitmap in pixels. */ |
26 struct PP_Size size; | 43 struct PP_Size size; |
27 | 44 |
28 /** The row width in bytes. This may be different than width * 4 since there | 45 /** The row width in bytes. This may be different than width * 4 since there |
29 * may be padding at the end of the lines. | 46 * may be padding at the end of the lines. |
30 */ | 47 */ |
31 int32_t stride; | 48 int32_t stride; |
32 }; | 49 }; |
33 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_ImageDataDesc, 16); | 50 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_ImageDataDesc, 16); |
| 51 /** |
| 52 * @} |
| 53 */ |
34 | 54 |
35 #define PPB_IMAGEDATA_INTERFACE "PPB_ImageData;0.3" | 55 #define PPB_IMAGEDATA_INTERFACE "PPB_ImageData;0.3" |
36 | 56 |
37 /** | 57 /** |
38 * @file | 58 * @addtogroup Interfaces |
39 * Defines the API ... | |
40 * | |
41 * @addtogroup PPB | |
42 * @{ | 59 * @{ |
43 */ | 60 */ |
44 | |
45 struct PPB_ImageData { | 61 struct PPB_ImageData { |
46 /** | 62 /** |
47 * Returns the browser's preferred format for image data. This format will be | 63 * Returns the browser's preferred format for image data. This format will be |
48 * the format is uses internally for painting. Other formats may require | 64 * the format is uses internally for painting. Other formats may require |
49 * internal conversions to paint or may have additional restrictions depending | 65 * internal conversions to paint or may have additional restrictions depending |
50 * on the function. | 66 * on the function. |
51 */ | 67 */ |
52 PP_ImageDataFormat (*GetNativeImageDataFormat)(); | 68 PP_ImageDataFormat (*GetNativeImageDataFormat)(); |
53 | 69 |
54 /** | 70 /** |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 struct PP_ImageDataDesc* desc); | 106 struct PP_ImageDataDesc* desc); |
91 | 107 |
92 /** | 108 /** |
93 * Maps this bitmap into the plugin address space and returns a pointer to the | 109 * Maps this bitmap into the plugin address space and returns a pointer to the |
94 * beginning of the data. | 110 * beginning of the data. |
95 */ | 111 */ |
96 void* (*Map)(PP_Resource image_data); | 112 void* (*Map)(PP_Resource image_data); |
97 | 113 |
98 void (*Unmap)(PP_Resource image_data); | 114 void (*Unmap)(PP_Resource image_data); |
99 }; | 115 }; |
100 | |
101 /** | 116 /** |
102 * @} | 117 * @} |
103 * End addtogroup PPB | |
104 */ | 118 */ |
| 119 |
105 #endif /* PPAPI_C_PPB_IMAGE_DATA_H_ */ | 120 #endif /* PPAPI_C_PPB_IMAGE_DATA_H_ */ |
106 | 121 |
OLD | NEW |