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