]>
Commit | Line | Data |
---|---|---|
a48d0a3d CS |
1 | /** @file\r |
2 | Protocol which allows access to the images in the images database.\r | |
3 | \r | |
497a5fb1 | 4 | (C) Copyright 2016-2018 Hewlett Packard Enterprise Development LP<BR>\r |
a48d0a3d | 5 | \r |
9344f092 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
a48d0a3d | 7 | \r |
497a5fb1 SZ |
8 | @par Revision Reference:\r |
9 | This Protocol was introduced in UEFI Specification 2.6.\r | |
10 | \r | |
a48d0a3d CS |
11 | **/\r |
12 | \r | |
13 | #ifndef __EFI_HII_IMAGE_EX_H__\r | |
14 | #define __EFI_HII_IMAGE_EX_H__\r | |
15 | \r | |
16 | #include <Protocol/HiiImage.h>\r | |
17 | \r | |
18 | //\r | |
19 | // Global ID for the Hii Image Ex Protocol.\r | |
20 | //\r | |
21 | #define EFI_HII_IMAGE_EX_PROTOCOL_GUID \\r | |
22 | {0x1a1241e6, 0x8f19, 0x41a9, { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 0x65, 0x46 }}\r | |
23 | \r | |
24 | typedef struct _EFI_HII_IMAGE_EX_PROTOCOL EFI_HII_IMAGE_EX_PROTOCOL;\r | |
25 | \r | |
26 | /**\r | |
27 | The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.NewImage().\r | |
b16dd6c8 | 28 | This protocol invokes EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.\r |
a48d0a3d CS |
29 | \r |
30 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
31 | @param PackageList Handle of the package list where this image will\r | |
32 | be added.\r | |
33 | @param ImageId On return, contains the new image id, which is\r | |
34 | unique within PackageList.\r | |
35 | @param Image Points to the image.\r | |
36 | \r | |
37 | @retval EFI_SUCCESS The new image was added successfully.\r | |
38 | @retval EFI_NOT_FOUND The specified PackageList could not be found in\r | |
39 | database.\r | |
40 | @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.\r | |
41 | @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.\r | |
42 | \r | |
43 | **/\r | |
44 | typedef\r | |
45 | EFI_STATUS\r | |
46 | (EFIAPI *EFI_HII_NEW_IMAGE_EX)(\r | |
47 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
48 | IN EFI_HII_HANDLE PackageList,\r | |
49 | OUT EFI_IMAGE_ID *ImageId,\r | |
50 | IN CONST EFI_IMAGE_INPUT *Image\r | |
51 | );\r | |
52 | \r | |
53 | /**\r | |
54 | Return the information about the image, associated with the package list.\r | |
55 | The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.GetImage().\r | |
b16dd6c8 DB |
56 | \r |
57 | This function is similar to EFI_HII_IMAGE_PROTOCOL.GetImage().The difference is that\r | |
58 | this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the\r | |
59 | system if the decoder of the certain image type is not supported by the\r | |
60 | EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the\r | |
61 | EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that\r | |
62 | supports the requested image type.\r | |
a48d0a3d CS |
63 | \r |
64 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
b16dd6c8 DB |
65 | @param PackageList The package list in the HII database to search for the\r |
66 | specified image.\r | |
67 | @param ImageId The image's id, which is unique within PackageList.\r | |
a48d0a3d CS |
68 | @param Image Points to the image.\r |
69 | \r | |
70 | @retval EFI_SUCCESS The new image was returned successfully.\r | |
b16dd6c8 DB |
71 | @retval EFI_NOT_FOUND The image specified by ImageId is not available. The specified\r |
72 | PackageList is not in the Database.\r | |
73 | @retval EFI_INVALID_PARAMETER Image was NULL or ImageId was 0.\r | |
a48d0a3d CS |
74 | @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there\r |
75 | was not enough memory.\r | |
76 | \r | |
77 | **/\r | |
78 | typedef\r | |
79 | EFI_STATUS\r | |
80 | (EFIAPI *EFI_HII_GET_IMAGE_EX)(\r | |
81 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
82 | IN EFI_HII_HANDLE PackageList,\r | |
83 | IN EFI_IMAGE_ID ImageId,\r | |
84 | OUT EFI_IMAGE_INPUT *Image\r | |
85 | );\r | |
86 | \r | |
87 | /**\r | |
b16dd6c8 DB |
88 | Change the information about the image.\r |
89 | \r | |
90 | Same with EFI_HII_IMAGE_PROTOCOL.SetImage(),this protocol invokes\r | |
91 | EFI_HII_IMAGE_PROTOCOL.SetImage()implicitly.\r | |
a48d0a3d CS |
92 | \r |
93 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
94 | @param PackageList The package list containing the images.\r | |
b16dd6c8 | 95 | @param ImageId The image's id, which is unique within PackageList.\r |
a48d0a3d CS |
96 | @param Image Points to the image.\r |
97 | \r | |
b16dd6c8 | 98 | @retval EFI_SUCCESS The new image was successfully updated.\r |
a48d0a3d CS |
99 | @retval EFI_NOT_FOUND The image specified by ImageId is not in the\r |
100 | database. The specified PackageList is not in\r | |
101 | the database.\r | |
b16dd6c8 DB |
102 | @retval EFI_INVALID_PARAMETER The Image was NULL, the ImageId was 0 or\r |
103 | the Image->Bitmap was NULL.\r | |
a48d0a3d CS |
104 | \r |
105 | **/\r | |
106 | typedef\r | |
107 | EFI_STATUS\r | |
108 | (EFIAPI *EFI_HII_SET_IMAGE_EX)(\r | |
109 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
110 | IN EFI_HII_HANDLE PackageList,\r | |
111 | IN EFI_IMAGE_ID ImageId,\r | |
112 | IN CONST EFI_IMAGE_INPUT *Image\r | |
113 | );\r | |
114 | \r | |
115 | /**\r | |
b16dd6c8 DB |
116 | Renders an image to a bitmap or to the display.\r |
117 | \r | |
118 | The prototype of this extension function is the same with\r | |
119 | EFI_HII_IMAGE_PROTOCOL.DrawImage(). This protocol invokes\r | |
120 | EFI_HII_IMAGE_PROTOCOL.DrawImage() implicitly.\r | |
a48d0a3d CS |
121 | \r |
122 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
123 | @param Flags Describes how the image is to be drawn.\r | |
124 | @param Image Points to the image to be displayed.\r | |
125 | @param Blt If this points to a non-NULL on entry, this points\r | |
126 | to the image, which is Width pixels wide and\r | |
127 | Height pixels high. The image will be drawn onto\r | |
128 | this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r | |
b16dd6c8 DB |
129 | If this points to a NULL on entry, then a buffer\r |
130 | will be allocated to hold the generated image and\r | |
a48d0a3d CS |
131 | the pointer updated on exit. It is the caller's\r |
132 | responsibility to free this buffer.\r | |
133 | @param BltX Specifies the offset from the left and top edge of\r | |
b16dd6c8 | 134 | the output image of the first pixel in the image.\r |
a48d0a3d | 135 | @param BltY Specifies the offset from the left and top edge of\r |
b16dd6c8 | 136 | the output image of the first pixel in the image.\r |
a48d0a3d CS |
137 | \r |
138 | @retval EFI_SUCCESS The image was successfully drawn.\r | |
139 | @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r | |
140 | @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.\r | |
a48d0a3d CS |
141 | \r |
142 | **/\r | |
143 | typedef\r | |
144 | EFI_STATUS\r | |
145 | (EFIAPI *EFI_HII_DRAW_IMAGE_EX)(\r | |
146 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
147 | IN EFI_HII_DRAW_FLAGS Flags,\r | |
148 | IN CONST EFI_IMAGE_INPUT *Image,\r | |
149 | IN OUT EFI_IMAGE_OUTPUT **Blt,\r | |
150 | IN UINTN BltX,\r | |
151 | IN UINTN BltY\r | |
152 | );\r | |
153 | \r | |
154 | /**\r | |
155 | Renders an image to a bitmap or the screen containing the contents of the specified\r | |
b16dd6c8 DB |
156 | image.\r |
157 | \r | |
158 | This function is similar to EFI_HII_IMAGE_PROTOCOL.DrawImageId(). The difference is that\r | |
159 | this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the\r | |
160 | system if the decoder of the certain image type is not supported by the\r | |
161 | EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the\r | |
162 | EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that\r | |
163 | supports the requested image type.\r | |
a48d0a3d CS |
164 | \r |
165 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
166 | @param Flags Describes how the image is to be drawn.\r | |
167 | @param PackageList The package list in the HII database to search for\r | |
168 | the specified image.\r | |
b16dd6c8 | 169 | @param ImageId The image's id, which is unique within PackageList.\r |
a48d0a3d CS |
170 | @param Blt If this points to a non-NULL on entry, this points\r |
171 | to the image, which is Width pixels wide and\r | |
172 | Height pixels high. The image will be drawn onto\r | |
173 | this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r | |
174 | If this points to a NULL on entry, then a buffer\r | |
175 | will be allocated to hold the generated image\r | |
176 | and the pointer updated on exit. It is the caller's\r | |
177 | responsibility to free this buffer.\r | |
178 | @param BltX Specifies the offset from the left and top edge of\r | |
179 | the output image of the first pixel in the image.\r | |
180 | @param BltY Specifies the offset from the left and top edge of\r | |
181 | the output image of the first pixel in the image.\r | |
182 | \r | |
183 | @retval EFI_SUCCESS The image was successfully drawn.\r | |
184 | @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r | |
b16dd6c8 | 185 | @retval EFI_INVALID_PARAMETER The Blt was NULL or ImageId was 0.\r |
a48d0a3d CS |
186 | @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.\r |
187 | The specified PackageList is not in the database.\r | |
188 | \r | |
189 | **/\r | |
190 | typedef\r | |
191 | EFI_STATUS\r | |
192 | (EFIAPI *EFI_HII_DRAW_IMAGE_ID_EX)(\r | |
193 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
194 | IN EFI_HII_DRAW_FLAGS Flags,\r | |
195 | IN EFI_HII_HANDLE PackageList,\r | |
196 | IN EFI_IMAGE_ID ImageId,\r | |
197 | IN OUT EFI_IMAGE_OUTPUT **Blt,\r | |
198 | IN UINTN BltX,\r | |
199 | IN UINTN BltY\r | |
200 | );\r | |
201 | \r | |
202 | /**\r | |
203 | This function returns the image information to EFI_IMAGE_OUTPUT. Only the width\r | |
204 | and height are returned to the EFI_IMAGE_OUTPUT instead of decoding the image\r | |
205 | to the buffer. This function is used to get the geometry of the image. This function\r | |
206 | will try to locate all of the EFI_HII_IMAGE_DECODER_PROTOCOL installed on the\r | |
207 | system if the decoder of image type is not supported by the EFI_HII_IMAGE_EX_PROTOCOL.\r | |
208 | \r | |
209 | @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r | |
210 | @param PackageList Handle of the package list where this image will\r | |
211 | be searched.\r | |
b16dd6c8 | 212 | @param ImageId The image's id, which is unique within PackageList.\r |
a48d0a3d CS |
213 | @param Image Points to the image.\r |
214 | \r | |
215 | @retval EFI_SUCCESS The new image was returned successfully.\r | |
216 | @retval EFI_NOT_FOUND The image specified by ImageId is not in the\r | |
217 | database. The specified PackageList is not in the database.\r | |
218 | @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to\r | |
219 | hold the image.\r | |
b16dd6c8 | 220 | @retval EFI_INVALID_PARAMETER The Image was NULL or the ImageId was 0.\r |
a48d0a3d CS |
221 | @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there\r |
222 | was not enough memory.\r | |
223 | \r | |
224 | **/\r | |
225 | typedef\r | |
226 | EFI_STATUS\r | |
227 | (EFIAPI *EFI_HII_GET_IMAGE_INFO)(\r | |
228 | IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r | |
229 | IN EFI_HII_HANDLE PackageList,\r | |
230 | IN EFI_IMAGE_ID ImageId,\r | |
6e227fb5 | 231 | OUT EFI_IMAGE_OUTPUT *Image\r |
a48d0a3d CS |
232 | );\r |
233 | \r | |
234 | ///\r | |
235 | /// Protocol which allows access to the images in the images database.\r | |
236 | ///\r | |
237 | struct _EFI_HII_IMAGE_EX_PROTOCOL {\r | |
2f88bd3a MK |
238 | EFI_HII_NEW_IMAGE_EX NewImageEx;\r |
239 | EFI_HII_GET_IMAGE_EX GetImageEx;\r | |
240 | EFI_HII_SET_IMAGE_EX SetImageEx;\r | |
241 | EFI_HII_DRAW_IMAGE_EX DrawImageEx;\r | |
242 | EFI_HII_DRAW_IMAGE_ID_EX DrawImageIdEx;\r | |
243 | EFI_HII_GET_IMAGE_INFO GetImageInfo;\r | |
a48d0a3d CS |
244 | };\r |
245 | \r | |
2f88bd3a | 246 | extern EFI_GUID gEfiHiiImageExProtocolGuid;\r |
a48d0a3d CS |
247 | \r |
248 | #endif\r |