iPXE
HiiImage.h
Go to the documentation of this file.
1/** @file
2 The file provides services to access to images in the images database.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 @par Revision Reference:
8 This Protocol was introduced in UEFI Specification 2.1.
9
10**/
11
12#pragma once
13
14FILE_LICENCE ( BSD2_PATENT );
15FILE_SECBOOT ( PERMITTED );
16
18
19#define EFI_HII_IMAGE_PROTOCOL_GUID \
20 { 0x31a6406a, 0x6bdf, 0x4e46, { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } }
21
23
24///
25/// Flags in EFI_IMAGE_INPUT
26///
27#define EFI_IMAGE_TRANSPARENT 0x00000001
28
29/**
30
31 Definition of EFI_IMAGE_INPUT.
32
33 @param Flags Describe image characteristics. If
34 EFI_IMAGE_TRANSPARENT is set, then the image was
35 designed for transparent display.
36
37 @param Width Image width, in pixels.
38
39 @param Height Image height, in pixels.
40
41 @param Bitmap A pointer to the actual bitmap, organized left-to-right,
42 top-to-bottom. The size of the bitmap is
43 Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).
44
45
46**/
53
54/**
55
56 This function adds the image Image to the group of images
57 owned by PackageList, and returns a new image identifier
58 (ImageId).
59
60 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
61
62 @param PackageList Handle of the package list where this image will be added.
63
64 @param ImageId On return, contains the new image id, which is
65 unique within PackageList.
66
67 @param Image Points to the image.
68
69 @retval EFI_SUCCESS The new image was added
70 successfully
71
72 @retval EFI_OUT_OF_RESOURCES Could not add the image.
73
74 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is
75 NULL.
76
77
78**/
79typedef
83 IN EFI_HII_HANDLE PackageList,
84 OUT EFI_IMAGE_ID *ImageId,
86 );
87
88/**
89
90 This function retrieves the image specified by ImageId which
91 is associated with the specified PackageList and copies it
92 into the buffer specified by Image. If the image specified by
93 ImageId is not present in the specified PackageList, then
94 EFI_NOT_FOUND is returned. If the buffer specified by
95 ImageSize is too small to hold the image, then
96 EFI_BUFFER_TOO_SMALL will be returned. ImageSize will be
97 updated to the size of buffer actually required to hold the
98 image.
99
100 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
101
102 @param PackageList The package list in the HII database to
103 search for the specified image.
104
105 @param ImageId The image's id, which is unique within
106 PackageList.
107
108 @param Image Points to the new image.
109
110 @retval EFI_SUCCESS The image was returned successfully.
111
112 @retval EFI_NOT_FOUND The image specified by ImageId is not
113 available. Or The specified PackageList is not in the database.
114
115 @retval EFI_INVALID_PARAMETER The Image or Langugae was NULL.
116 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not
117 enough memory.
118
119
120**/
121typedef
125 IN EFI_HII_HANDLE PackageList,
126 IN EFI_IMAGE_ID ImageId,
127 OUT EFI_IMAGE_INPUT *Image
128 );
129
130/**
131
132 This function updates the image specified by ImageId in the
133 specified PackageListHandle to the image specified by Image.
134
135
136 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
137
138 @param PackageList The package list containing the images.
139
140 @param ImageId The image id, which is unique within PackageList.
141
142 @param Image Points to the image.
143
144 @retval EFI_SUCCESS The image was successfully updated.
145
146 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
147 The specified PackageList is not in the database.
148
149 @retval EFI_INVALID_PARAMETER The Image or Language was NULL.
150
151**/
152typedef
156 IN EFI_HII_HANDLE PackageList,
157 IN EFI_IMAGE_ID ImageId,
159 );
160
161///
162/// EFI_HII_DRAW_FLAGS describes how the image is to be drawn.
163/// These flags are defined as EFI_HII_DRAW_FLAG_***
164///
166
167#define EFI_HII_DRAW_FLAG_CLIP 0x00000001
168#define EFI_HII_DRAW_FLAG_TRANSPARENT 0x00000030
169#define EFI_HII_DRAW_FLAG_DEFAULT 0x00000000
170#define EFI_HII_DRAW_FLAG_FORCE_TRANS 0x00000010
171#define EFI_HII_DRAW_FLAG_FORCE_OPAQUE 0x00000020
172#define EFI_HII_DIRECT_TO_SCREEN 0x00000080
173
174/**
175
176 Definition of EFI_IMAGE_OUTPUT.
177
178 @param Width Width of the output image.
179
180 @param Height Height of the output image.
181
182 @param Bitmap Points to the output bitmap.
183
184 @param Screen Points to the EFI_GRAPHICS_OUTPUT_PROTOCOL which
185 describes the screen on which to draw the
186 specified image.
187
188**/
197
198/**
199
200 This function renders an image to a bitmap or the screen using
201 the specified color and options. It draws the image on an
202 existing bitmap, allocates a new bitmap or uses the screen. The
203 images can be clipped. If EFI_HII_DRAW_FLAG_CLIP is set, then
204 all pixels drawn outside the bounding box specified by Width and
205 Height are ignored. If EFI_HII_DRAW_FLAG_TRANSPARENT is set,
206 then all 'off' pixels in the images drawn will use the
207 pixel value from Blt. This flag cannot be used if Blt is NULL
208 upon entry. If EFI_HII_DIRECT_TO_SCREEN is set, then the image
209 will be written directly to the output device specified by
210 Screen. Otherwise the image will be rendered to the bitmap
211 specified by Bitmap.
212
213
214 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
215
216 @param Flags Describes how the image is to be drawn.
217 EFI_HII_DRAW_FLAGS is defined in Related
218 Definitions, below.
219
220 @param Image Points to the image to be displayed.
221
222 @param Blt If this points to a non-NULL on entry, this points
223 to the image, which is Width pixels wide and
224 Height pixels high. The image will be drawn onto
225 this image and EFI_HII_DRAW_FLAG_CLIP is implied.
226 If this points to a NULL on entry, then a buffer
227 will be allocated to hold the generated image and
228 the pointer updated on exit. It is the caller's
229 responsibility to free this buffer.
230
231 @param BltX, BltY Specifies the offset from the left and top
232 edge of the image of the first pixel in
233 the image.
234
235 @retval EFI_SUCCESS The image was successfully updated.
236
237 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output
238 buffer for RowInfoArray or Blt.
239
240 @retval EFI_INVALID_PARAMETER The Image or Blt or Height or
241 Width was NULL.
242
243
244**/
245typedef
250 IN CONST EFI_IMAGE_INPUT *Image,
251 IN OUT EFI_IMAGE_OUTPUT **Blt,
252 IN UINTN BltX,
253 IN UINTN BltY
254 );
255
256/**
257
258 This function renders an image as a bitmap or to the screen and
259 can clip the image. The bitmap is either supplied by the caller
260 or else is allocated by the function. The images can be drawn
261 transparently or opaquely. If EFI_HII_DRAW_FLAG_CLIP is set,
262 then all pixels drawn outside the bounding box specified by
263 Width and Height are ignored. If EFI_HII_DRAW_FLAG_TRANSPARENT
264 is set, then all "off" pixels in the character's glyph will
265 use the pixel value from Blt. This flag cannot be used if Blt
266 is NULL upon entry. If EFI_HII_DIRECT_TO_SCREEN is set, then
267 the image will be written directly to the output device
268 specified by Screen. Otherwise the image will be rendered to
269 the bitmap specified by Bitmap.
270 This function renders an image to a bitmap or the screen using
271 the specified color and options. It draws the image on an
272 existing bitmap, allocates a new bitmap or uses the screen. The
273 images can be clipped. If EFI_HII_DRAW_FLAG_CLIP is set, then
274 all pixels drawn outside the bounding box specified by Width and
275 Height are ignored. The EFI_HII_DRAW_FLAG_TRANSPARENT flag
276 determines whether the image will be drawn transparent or
277 opaque. If EFI_HII_DRAW_FLAG_FORCE_TRANS is set, then the image
278 will be drawn so that all 'off' pixels in the image will
279 be drawn using the pixel value from Blt and all other pixels
280 will be copied. If EFI_HII_DRAW_FLAG_FORCE_OPAQUE is set, then
281 the image's pixels will be copied directly to the
282 destination. If EFI_HII_DRAW_FLAG_DEFAULT is set, then the image
283 will be drawn transparently or opaque, depending on the
284 image's transparency setting (see EFI_IMAGE_TRANSPARENT).
285 Images cannot be drawn transparently if Blt is NULL. If
286 EFI_HII_DIRECT_TO_SCREEN is set, then the image will be written
287 directly to the output device specified by Screen. Otherwise the
288 image will be rendered to the bitmap specified by Bitmap.
289
290 @param This A pointer to the EFI_HII_IMAGE_PROTOCOL instance.
291
292 @param Flags Describes how the image is to be drawn.
293
294 @param PackageList The package list in the HII database to
295 search for the specified image.
296
297 @param ImageId The image's id, which is unique within PackageList.
298
299 @param Blt If this points to a non-NULL on entry, this points
300 to the image, which is Width pixels wide and
301 Height pixels high. The image will be drawn onto
302 this image and EFI_HII_DRAW_FLAG_CLIP is implied.
303 If this points to a NULL on entry, then a buffer
304 will be allocated to hold the generated image and
305 the pointer updated on exit. It is the caller's
306 responsibility to free this buffer.
307
308 @param BltX, BltY Specifies the offset from the left and top
309 edge of the output image of the first
310 pixel in the image.
311
312 @retval EFI_SUCCESS The image was successfully updated.
313
314 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output
315 buffer for RowInfoArray or Blt.
316
317 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.
318 Or The specified PackageList is not in the database.
319
320 @retval EFI_INVALID_PARAMETER The Blt was NULL.
321
322**/
323typedef
328 IN EFI_HII_HANDLE PackageList,
329 IN EFI_IMAGE_ID ImageId,
330 IN OUT EFI_IMAGE_OUTPUT **Blt,
331 IN UINTN BltX,
332 IN UINTN BltY
333 );
334
335///
336/// Services to access to images in the images database.
337///
345
unsigned short UINT16
2-byte unsigned value.
UINT64 UINTN
Unsigned value of native width.
#define EFIAPI
unsigned int UINT32
4-byte unsigned value.
#define CONST
Datum is read-only.
Definition Base.h:261
Graphics Output Protocol from the UEFI 2.0 specification.
struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL
EFI_STATUS(EFIAPI * EFI_HII_NEW_IMAGE)(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, OUT EFI_IMAGE_ID *ImageId, IN CONST EFI_IMAGE_INPUT *Image)
This function adds the image Image to the group of images owned by PackageList, and returns a new ima...
Definition HiiImage.h:81
UINT32 EFI_HII_DRAW_FLAGS
EFI_HII_DRAW_FLAGS describes how the image is to be drawn.
Definition HiiImage.h:165
EFI_GUID gEfiHiiImageProtocolGuid
EFI_STATUS(EFIAPI * EFI_HII_SET_IMAGE)(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, IN CONST EFI_IMAGE_INPUT *Image)
This function updates the image specified by ImageId in the specified PackageListHandle to the image ...
Definition HiiImage.h:154
struct _EFI_HII_IMAGE_PROTOCOL EFI_HII_IMAGE_PROTOCOL
Definition HiiImage.h:22
EFI_STATUS(EFIAPI * EFI_HII_DRAW_IMAGE)(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_DRAW_FLAGS Flags, IN CONST EFI_IMAGE_INPUT *Image, IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY)
This function renders an image to a bitmap or the screen using the specified color and options.
Definition HiiImage.h:247
struct _EFI_IMAGE_INPUT EFI_IMAGE_INPUT
Definition of EFI_IMAGE_INPUT.
struct _EFI_IMAGE_OUTPUT EFI_IMAGE_OUTPUT
Definition of EFI_IMAGE_OUTPUT.
EFI_STATUS(EFIAPI * EFI_HII_DRAW_IMAGE_ID)(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_DRAW_FLAGS Flags, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY)
This function renders an image as a bitmap or to the screen and can clip the image.
Definition HiiImage.h:325
EFI_STATUS(EFIAPI * EFI_HII_GET_IMAGE)(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, OUT EFI_IMAGE_INPUT *Image)
This function retrieves the image specified by ImageId which is associated with the specified Package...
Definition HiiImage.h:123
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
VOID * EFI_HII_HANDLE
The following types are currently defined:
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
UINT16_t Flags
Flags.
Definition pxe_api.h:30
Services to access to images in the images database.
Definition HiiImage.h:338
EFI_HII_DRAW_IMAGE_ID DrawImageId
Definition HiiImage.h:343
EFI_HII_NEW_IMAGE NewImage
Definition HiiImage.h:339
EFI_HII_GET_IMAGE GetImage
Definition HiiImage.h:340
EFI_HII_SET_IMAGE SetImage
Definition HiiImage.h:341
EFI_HII_DRAW_IMAGE DrawImage
Definition HiiImage.h:342
Definition of EFI_IMAGE_INPUT.
Definition HiiImage.h:47
EFI_GRAPHICS_OUTPUT_BLT_PIXEL * Bitmap
Definition HiiImage.h:51
Definition of EFI_IMAGE_OUTPUT.
Definition HiiImage.h:189
union _EFI_IMAGE_OUTPUT::@027206233250216234376274121372340236112234347110 Image
EFI_GRAPHICS_OUTPUT_BLT_PIXEL * Bitmap
Definition HiiImage.h:193
EFI_GRAPHICS_OUTPUT_PROTOCOL * Screen
Definition HiiImage.h:194