break;\r
\r
case EFI_HII_IIBT_IMAGE_JPEG:\r
- Length = ReadUnaligned32 ((VOID *) &((EFI_HII_IIBT_JPEG_BLOCK *) CurrentImageBlock)->Size);\r
+ Length = OFFSET_OF (EFI_HII_IIBT_JPEG_BLOCK, Data) + ReadUnaligned32 ((VOID *) &((EFI_HII_IIBT_JPEG_BLOCK *) CurrentImageBlock)->Size);\r
+ ImageIdCurrent++;\r
+ break;\r
+\r
+ case EFI_HII_IIBT_IMAGE_PNG:\r
+ Length = OFFSET_OF (EFI_HII_IIBT_PNG_BLOCK, Data) + ReadUnaligned32 ((VOID *) &((EFI_HII_IIBT_PNG_BLOCK *) CurrentImageBlock)->Size);\r
ImageIdCurrent++;\r
break;\r
\r
\r
switch (CurrentImageBlock->BlockType) {\r
case EFI_HII_IIBT_IMAGE_JPEG:\r
+ case EFI_HII_IIBT_IMAGE_PNG:\r
//\r
- // BUGBUG: need to be supported as soon as image tool is designed.\r
+ // HiiImage protocol doesn't support return JPEG/PNG.\r
+ // Use HiiImageEx instead.\r
//\r
return EFI_UNSUPPORTED;\r
\r
//\r
switch (CurrentImageBlock->BlockType) {\r
case EFI_HII_IIBT_IMAGE_JPEG:\r
- //\r
- // BUGBUG: need to be supported as soon as image tool is designed.\r
- //\r
- return EFI_UNSUPPORTED;\r
-\r
+ OldBlockSize = OFFSET_OF (EFI_HII_IIBT_JPEG_BLOCK, Data) + ReadUnaligned32 ((VOID *) &((EFI_HII_IIBT_JPEG_BLOCK *) CurrentImageBlock)->Size);\r
+ break;\r
+ case EFI_HII_IIBT_IMAGE_PNG:\r
+ OldBlockSize = OFFSET_OF (EFI_HII_IIBT_PNG_BLOCK, Data) + ReadUnaligned32 ((VOID *) &((EFI_HII_IIBT_PNG_BLOCK *) CurrentImageBlock)->Size);\r
+ break;\r
case EFI_HII_IIBT_IMAGE_1BIT:\r
case EFI_HII_IIBT_IMAGE_1BIT_TRANS:\r
OldBlockSize = sizeof (EFI_HII_IIBT_IMAGE_1BIT_BLOCK) - sizeof (UINT8) +\r
EFI_STATUS Status;\r
HII_DATABASE_PRIVATE_DATA *Private;\r
BOOLEAN Transparent;\r
- EFI_IMAGE_INPUT *ImageIn;\r
EFI_IMAGE_OUTPUT *ImageOut;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer;\r
UINTN BufferLen;\r
}\r
\r
FontInfo = NULL;\r
- ImageIn = (EFI_IMAGE_INPUT *) Image;\r
\r
//\r
// Check whether the image will be drawn transparently or opaquely.\r
// Now EFI_HII_DRAW_FLAG_DEFAULT is set, whether image will be drawn depending\r
// on the image's transparency setting.\r
//\r
- if ((ImageIn->Flags & EFI_IMAGE_TRANSPARENT) == EFI_IMAGE_TRANSPARENT) {\r
+ if ((Image->Flags & EFI_IMAGE_TRANSPARENT) == EFI_IMAGE_TRANSPARENT) {\r
Transparent = TRUE;\r
}\r
}\r
// Clip the image by (Width, Height)\r
//\r
\r
- Width = ImageIn->Width;\r
- Height = ImageIn->Height;\r
+ Width = Image->Width;\r
+ Height = Image->Height;\r
\r
if (Width > (*Blt)->Width - BltX) {\r
Width = (*Blt)->Width - BltX;\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
- if (Width == ImageIn->Width && Height == ImageIn->Height) {\r
- CopyMem (BltBuffer, ImageIn->Bitmap, BufferLen);\r
+ if (Width == Image->Width && Height == Image->Height) {\r
+ CopyMem (BltBuffer, Image->Bitmap, BufferLen);\r
} else {\r
for (Ypos = 0; Ypos < Height; Ypos++) {\r
- OffsetY1 = ImageIn->Width * Ypos;\r
+ OffsetY1 = Image->Width * Ypos;\r
OffsetY2 = Width * Ypos;\r
for (Xpos = 0; Xpos < Width; Xpos++) {\r
- BltBuffer[OffsetY2 + Xpos] = ImageIn->Bitmap[OffsetY1 + Xpos];\r
+ BltBuffer[OffsetY2 + Xpos] = Image->Bitmap[OffsetY1 + Xpos];\r
}\r
}\r
}\r
//\r
// Allocate a new bitmap to hold the incoming image.\r
//\r
- Width = ImageIn->Width + BltX;\r
- Height = ImageIn->Height + BltY;\r
+ Width = Image->Width + BltX;\r
+ Height = Image->Height + BltY;\r
\r
BufferLen = Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);\r
BltBuffer = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) AllocateZeroPool (BufferLen);\r
//\r
*Blt = ImageOut;\r
return ImageToBlt (\r
- ImageIn->Bitmap,\r
+ Image->Bitmap,\r
BltX,\r
BltY,\r
- ImageIn->Width,\r
- ImageIn->Height,\r
+ Image->Width,\r
+ Image->Height,\r
Transparent,\r
Blt\r
);\r