]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/HiiImage.h
Fix doxygen comment for structure and macro
[mirror_edk2.git] / MdePkg / Include / Protocol / HiiImage.h
CommitLineData
d1f95000 1/** @file\r
2 The file provides services to access to images in the images database.\r
3 \r
54cf8780 4 Copyright (c) 2006 - 2008, Intel Corporation\r
d1f95000 5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
d1f95000 13**/\r
14\r
15#ifndef __HII_IMAGE_H__\r
16#define __HII_IMAGE_H__\r
17\r
d1f95000 18#define EFI_HII_IMAGE_PROTOCOL_GUID \\r
19 { 0x31a6406a, 0x6bdf, 0x4e46, { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } }\r
20\r
21typedef struct _EFI_HII_IMAGE_PROTOCOL EFI_HII_IMAGE_PROTOCOL;\r
22\r
23\r
99e8ed21 24///\r
25/// Flags in EFI_IMAGE_INPUT\r
26/// \r
d1f95000 27#define EFI_IMAGE_TRANSPARENT 0x00000001\r
28\r
29/**\r
30 \r
31 Definition of EFI_IMAGE_INPUT.\r
32 \r
33 @param Flags Describe image characteristics. If\r
34 EFI_IMAGE_TRANSPARENT is set, then the image was\r
35 designed for transparent display.\r
36\r
37 @param Width Image width, in pixels. \r
38\r
39 @param Height Image height, in pixels.\r
40\r
41 @param Bitmap The actual bitmap, organized left-to-right,\r
42 top-to-bottom. The size of the bitmap is\r
43 Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).\r
44\r
45 \r
46**/\r
47typedef struct _EFI_IMAGE_INPUT {\r
7d582d6b 48 UINT32 Flags;\r
49 UINT16 Width;\r
50 UINT16 Height;\r
54cf8780 51 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;\r
d1f95000 52} EFI_IMAGE_INPUT;\r
53\r
54\r
55/**\r
56\r
57 This function adds the image Image to the group of images\r
58 owned by PackageList, and returns a new image identifier\r
59 (ImageId).\r
60\r
4ca9b6c4
LG
61 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
62 \r
63 @param PackageList Handle of the package list where this image will be added.\r
d1f95000 64\r
4ca9b6c4
LG
65 @param ImageId On return, contains the new image id, which is\r
66 unique within PackageList.\r
d1f95000 67\r
4ca9b6c4 68 @param Image Points to the image.\r
d1f95000 69\r
70 @retval EFI_SUCCESS The new image was added\r
71 successfully\r
72 \r
73 @retval EFI_OUT_OF_RESOURCES Could not add the image.\r
74 \r
75 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is\r
76 NULL.\r
77\r
78\r
79**/\r
80typedef\r
81EFI_STATUS\r
8b13229b 82(EFIAPI *EFI_HII_NEW_IMAGE)(\r
d1f95000 83 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
7d582d6b 84 IN EFI_HII_HANDLE PackageList,\r
d1f95000 85 OUT EFI_IMAGE_ID *ImageId,\r
86 IN CONST EFI_IMAGE_INPUT *Image\r
87);\r
88\r
89/**\r
90\r
91 This function retrieves the image specified by ImageId which\r
92 is associated with the specified PackageList and copies it\r
93 into the buffer specified by Image. If the image specified by\r
94 ImageId is not present in the specified PackageList, then\r
95 EFI_NOT_FOUND is returned. If the buffer specified by\r
96 ImageSize is too small to hold the image, then\r
97 EFI_BUFFER_TOO_SMALL will be returned. ImageSize will be\r
98 updated to the size of buffer actually required to hold the\r
99 image.\r
100\r
4ca9b6c4 101 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
d1f95000 102 \r
103 @param PackageList The package list in the HII database to\r
104 search for the specified image.\r
105 \r
4ca9b6c4
LG
106 @param ImageId The image's id, which is unique within\r
107 PackageList.\r
d1f95000 108 \r
4ca9b6c4 109 @param Image Points to the new image.\r
d1f95000 110 \r
4ca9b6c4
LG
111 @retval EFI_SUCCESS The image was returned successfully.\r
112\r
113 @retval EFI_NOT_FOUND The image specified by ImageId is not\r
114 available. Or The specified PackageList is not in the database.\r
d1f95000 115 \r
4ca9b6c4 116 @retval EFI_INVALID_PARAMETER The Image or Langugae was NULL.\r
54cf8780 117 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not\r
4ca9b6c4 118 enough memory.\r
d1f95000 119\r
120\r
121**/\r
122typedef\r
123EFI_STATUS\r
8b13229b 124(EFIAPI *EFI_HII_GET_IMAGE)(\r
d1f95000 125 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
7d582d6b 126 IN EFI_HII_HANDLE PackageList,\r
127 IN EFI_IMAGE_ID ImageId,\r
54cf8780 128 OUT EFI_IMAGE_INPUT *Image\r
d1f95000 129);\r
130\r
131/**\r
132 \r
133 This function updates the image specified by ImageId in the\r
134 specified PackageListHandle to the image specified by Image.\r
135\r
136\r
4ca9b6c4 137 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
d1f95000 138\r
139 @param PackageList The package list containing the images.\r
140\r
4ca9b6c4 141 @param ImageId The image id, which is unique within PackageList.\r
d1f95000 142\r
4ca9b6c4 143 @param Image Points to the image.\r
d1f95000 144\r
4ca9b6c4 145 @retval EFI_SUCCESS The image was successfully updated.\r
d1f95000 146 \r
4ca9b6c4
LG
147 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.\r
148 The specified PackageList is not in the database. \r
d1f95000 149 \r
4ca9b6c4 150 @retval EFI_INVALID_PARAMETER The Image or Language was NULL.\r
d1f95000 151\r
152**/\r
153typedef\r
154EFI_STATUS\r
8b13229b 155(EFIAPI *EFI_HII_SET_IMAGE)(\r
d1f95000 156 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
7d582d6b 157 IN EFI_HII_HANDLE PackageList,\r
158 IN EFI_IMAGE_ID ImageId,\r
159 IN CONST EFI_IMAGE_INPUT *Image\r
d1f95000 160);\r
161\r
162\r
163//\r
164// EFI_HII_DRAW_FLAGS\r
165// \r
166typedef UINT32 EFI_HII_DRAW_FLAGS;\r
167\r
168#define EFI_HII_DRAW_FLAG_CLIP 0x00000001\r
169#define EFI_HII_DRAW_FLAG_TRANSPARENT 0x00000030\r
170#define EFI_HII_DRAW_FLAG_DEFAULT 0x00000000\r
54cf8780 171#define EFI_HII_DRAW_FLAG_FORCE_TRANS 0x00000010\r
172#define EFI_HII_DRAW_FLAG_FORCE_OPAQUE 0x00000020\r
d1f95000 173#define EFI_HII_DIRECT_TO_SCREEN 0x00000080\r
174\r
175\r
176/**\r
177 \r
178 Definition of EFI_IMAGE_OUTPUT.\r
179 \r
180 @param Width Width of the output image.\r
181\r
182 @param Height Height of the output image.\r
183\r
184 @param Bitmap Points to the output bitmap.\r
185\r
186 @param Screen Points to the EFI_GRAPHICS_OUTPUT_PROTOCOL which\r
187 describes the screen on which to draw the\r
188 specified image.\r
189\r
190**/\r
191typedef struct _EFI_IMAGE_OUTPUT {\r
192 UINT16 Width;\r
193 UINT16 Height;\r
194 union {\r
195 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;\r
196 EFI_GRAPHICS_OUTPUT_PROTOCOL *Screen;\r
197 } Image;\r
198} EFI_IMAGE_OUTPUT;\r
199\r
200\r
201/**\r
202 \r
203 This function renders an image to a bitmap or the screen using\r
204 the specified color and options. It draws the image on an\r
205 existing bitmap, allocates a new bitmap or uses the screen. The\r
206 images can be clipped. If EFI_HII_DRAW_FLAG_CLIP is set, then\r
207 all pixels drawn outside the bounding box specified by Width and\r
208 Height are ignored. If EFI_HII_DRAW_FLAG_TRANSPARENT is set,\r
4ca9b6c4 209 then all 'off' pixels in the images drawn will use the\r
d1f95000 210 pixel value from Blt. This flag cannot be used if Blt is NULL\r
211 upon entry. If EFI_HII_DIRECT_TO_SCREEN is set, then the image\r
212 will be written directly to the output device specified by\r
213 Screen. Otherwise the image will be rendered to the bitmap\r
214 specified by Bitmap.\r
215\r
216\r
4ca9b6c4
LG
217 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
218 \r
219 @param Flags Describes how the image is to be drawn.\r
220 EFI_HII_DRAW_FLAGS is defined in Related\r
221 Definitions, below.\r
d1f95000 222 \r
4ca9b6c4 223 @param Image Points to the image to be displayed. \r
d1f95000 224 \r
4ca9b6c4
LG
225 @param Blt If this points to a non-NULL on entry, this points\r
226 to the image, which is Width pixels wide and\r
227 Height pixels high. The image will be drawn onto\r
228 this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r
229 If this points to a NULL on entry, then a buffer\r
230 will be allocated to hold the generated image and\r
231 the pointer updated on exit. It is the caller's\r
232 responsibility to free this buffer.\r
d1f95000 233\r
4ca9b6c4
LG
234 @param BltX, BltY Specifies the offset from the left and top\r
235 edge of the image of the first pixel in\r
236 the image.\r
d1f95000 237\r
4ca9b6c4 238 @retval EFI_SUCCESS The image was successfully updated.\r
d1f95000 239\r
240 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output\r
241 buffer for RowInfoArray or Blt.\r
242\r
243 @retval EFI_INVALID_PARAMETER The Image or Blt or Height or\r
244 Width was NULL.\r
245\r
246\r
247**/\r
248typedef\r
249EFI_STATUS\r
8b13229b 250(EFIAPI *EFI_HII_DRAW_IMAGE)(\r
d1f95000 251 IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
7d582d6b 252 IN EFI_HII_DRAW_FLAGS Flags,\r
253 IN CONST EFI_IMAGE_INPUT *Image,\r
d1f95000 254 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
7d582d6b 255 IN UINTN BltX,\r
256 IN UINTN BltY\r
d1f95000 257);\r
258\r
259/**\r
260 \r
261 This function renders an image as a bitmap or to the screen and\r
262 can clip the image. The bitmap is either supplied by the caller\r
263 or else is allocated by the function. The images can be drawn\r
264 transparently or opaquely. If EFI_HII_DRAW_FLAG_CLIP is set,\r
265 then all pixels drawn outside the bounding box specified by\r
266 Width and Height are ignored. If EFI_HII_DRAW_FLAG_TRANSPARENT\r
267 is set, then all "off" pixels in the character's glyph will\r
268 use the pixel value from Blt. This flag cannot be used if Blt\r
269 is NULL upon entry. If EFI_HII_DIRECT_TO_SCREEN is set, then\r
270 the image will be written directly to the output device\r
271 specified by Screen. Otherwise the image will be rendered to\r
272 the bitmap specified by Bitmap.\r
273 This function renders an image to a bitmap or the screen using\r
274 the specified color and options. It draws the image on an\r
275 existing bitmap, allocates a new bitmap or uses the screen. The\r
276 images can be clipped. If EFI_HII_DRAW_FLAG_CLIP is set, then\r
277 all pixels drawn outside the bounding box specified by Width and\r
278 Height are ignored. The EFI_HII_DRAW_FLAG_TRANSPARENT flag\r
279 determines whether the image will be drawn transparent or\r
280 opaque. If EFI_HII_DRAW_FLAG_FORCE_TRANS is set, then the image\r
4ca9b6c4 281 will be drawn so that all 'off' pixels in the image will\r
d1f95000 282 be drawn using the pixel value from Blt and all other pixels\r
283 will be copied. If EFI_HII_DRAW_FLAG_FORCE_OPAQUE is set, then\r
4ca9b6c4 284 the image's pixels will be copied directly to the\r
d1f95000 285 destination. If EFI_HII_DRAW_FLAG_DEFAULT is set, then the image\r
286 will be drawn transparently or opaque, depending on the\r
4ca9b6c4 287 image's transparency setting (see EFI_IMAGE_TRANSPARENT).\r
d1f95000 288 Images cannot be drawn transparently if Blt is NULL. If\r
289 EFI_HII_DIRECT_TO_SCREEN is set, then the image will be written\r
290 directly to the output device specified by Screen. Otherwise the\r
291 image will be rendered to the bitmap specified by Bitmap.\r
292\r
4ca9b6c4 293 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance. \r
d1f95000 294\r
4ca9b6c4 295 @param Flags Describes how the image is to be drawn.\r
d1f95000 296\r
297 @param PackageList The package list in the HII database to\r
298 search for the specified image.\r
299\r
4ca9b6c4 300 @param ImageId The image's id, which is unique within PackageList.\r
d1f95000 301\r
4ca9b6c4
LG
302 @param Blt If this points to a non-NULL on entry, this points\r
303 to the image, which is Width pixels wide and\r
304 Height pixels high. The image will be drawn onto\r
305 this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r
306 If this points to a NULL on entry, then a buffer\r
307 will be allocated to hold the generated image and\r
308 the pointer updated on exit. It is the caller's\r
309 responsibility to free this buffer.\r
d1f95000 310\r
311 @param BltX, BltY Specifies the offset from the left and top\r
312 edge of the output image of the first\r
313 pixel in the image.\r
314\r
4ca9b6c4 315 @retval EFI_SUCCESS The image was successfully updated.\r
d1f95000 316 \r
317 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output\r
318 buffer for RowInfoArray or Blt.\r
319 \r
4ca9b6c4
LG
320 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database. \r
321 Or The specified PackageList is not in the database. \r
322 \r
323 @retval EFI_INVALID_PARAMETER The Blt was NULL. \r
d1f95000 324\r
325**/\r
326typedef\r
327EFI_STATUS\r
8b13229b 328(EFIAPI *EFI_HII_DRAW_IMAGE_ID)(\r
d1f95000 329IN CONST EFI_HII_IMAGE_PROTOCOL *This,\r
7d582d6b 330IN EFI_HII_DRAW_FLAGS Flags,\r
331IN EFI_HII_HANDLE PackageList,\r
332IN EFI_IMAGE_ID ImageId,\r
d1f95000 333IN OUT EFI_IMAGE_OUTPUT **Blt,\r
7d582d6b 334IN UINTN BltX,\r
335IN UINTN BltY\r
d1f95000 336);\r
337\r
338\r
339/**\r
4ca9b6c4
LG
340 @par Protocol Description: \r
341 Services to access to images in the images database.\r
d1f95000 342**/\r
343struct _EFI_HII_IMAGE_PROTOCOL {\r
344 EFI_HII_NEW_IMAGE NewImage;\r
345 EFI_HII_GET_IMAGE GetImage;\r
346 EFI_HII_SET_IMAGE SetImage;\r
347 EFI_HII_DRAW_IMAGE DrawImage;\r
348 EFI_HII_DRAW_IMAGE_ID DrawImageId;\r
349};\r
350\r
351extern EFI_GUID gEfiHiiImageProtocolGuid;\r
352\r
353#endif\r
354\r
7d582d6b 355\r