TianoCore EDK2 master
|
#include "HiiDatabase.h"
Go to the source code of this file.
Macros | |
#define | MAX_UINT24 0xFFFFFF |
Implementation for EFI_HII_IMAGE_PROTOCOL.
Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Image.c.
VOID CopyGopToRgbPixel | ( | OUT EFI_HII_RGB_PIXEL * | BitMapOut, |
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL * | BitMapIn, | ||
IN UINTN | PixelNum | ||
) |
Convert pixels from EFI_GRAPHICS_OUTPUT_BLT_PIXEL to EFI_HII_RGB_PIXEL style.
This is a internal function.
BitMapOut | Pixels in EFI_HII_RGB_PIXEL format. |
BitMapIn | Pixels in EFI_GRAPHICS_OUTPUT_BLT_PIXEL format. |
PixelNum | The number of pixels to be converted. |
VOID CopyRgbToGopPixel | ( | OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL * | BitMapOut, |
IN EFI_HII_RGB_PIXEL * | BitMapIn, | ||
IN UINTN | PixelNum | ||
) |
Convert pixels from EFI_HII_RGB_PIXEL to EFI_GRAPHICS_OUTPUT_BLT_PIXEL style.
This is a internal function.
BitMapOut | Pixels in EFI_GRAPHICS_OUTPUT_BLT_PIXEL format. |
BitMapIn | Pixels in EFI_HII_RGB_PIXEL format. |
PixelNum | The number of pixels to be converted. |
EFI_HII_IMAGE_BLOCK * GetImageIdOrAddress | ( | IN EFI_HII_IMAGE_BLOCK * | ImageBlocks, |
IN OUT EFI_IMAGE_ID * | ImageId | ||
) |
Get the imageid of last image block: EFI_HII_IIBT_END_BLOCK when input ImageId is zero, otherwise return the address of the corresponding image block with identifier specified by ImageId.
This is a internal function.
ImageBlocks | Points to the beginning of a series of image blocks stored in order. |
ImageId | If input ImageId is 0, output the image id of the EFI_HII_IIBT_END_BLOCK; else use this id to find its corresponding image block address. |
EFI_STATUS EFIAPI HiiDrawImage | ( | 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. It draws the image on an existing bitmap, allocates a new bitmap or uses the screen. The images can be clipped.
This | A pointer to the EFI_HII_IMAGE_PROTOCOL instance. |
Flags | Describes how the image is to be drawn. |
Image | Points to the image to be displayed. |
Blt | If this points to a non-NULL on entry, this points to the image, which is Width pixels wide and Height pixels high. The image will be drawn onto this image and EFI_HII_DRAW_FLAG_CLIP is implied. If this points to a NULL on entry, then a buffer will be allocated to hold the generated image and the pointer updated on exit. It is the caller's responsibility to free this buffer. |
BltX | Specifies the offset from the left and top edge of the output image of the first pixel in the image. |
BltY | Specifies the offset from the left and top edge of the output image of the first pixel in the image. |
EFI_SUCCESS | The image was successfully drawn. |
EFI_OUT_OF_RESOURCES | Unable to allocate an output buffer for Blt. |
EFI_INVALID_PARAMETER | The Image or Blt was NULL. |
EFI_INVALID_PARAMETER | Any combination of Flags is invalid. |
EFI_STATUS EFIAPI HiiDrawImageId | ( | 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 to a bitmap or the screen using the specified color and options. It draws the image on an existing bitmap, allocates a new bitmap or uses the screen. The images can be clipped.
This | A pointer to the EFI_HII_IMAGE_PROTOCOL instance. |
Flags | Describes how the image is to be drawn. |
PackageList | The package list in the HII database to search for the specified image. |
ImageId | The image's id, which is unique within PackageList. |
Blt | If this points to a non-NULL on entry, this points to the image, which is Width pixels wide and Height pixels high. The image will be drawn onto this image and EFI_HII_DRAW_FLAG_CLIP is implied. If this points to a NULL on entry, then a buffer will be allocated to hold the generated image and the pointer updated on exit. It is the caller's responsibility to free this buffer. |
BltX | Specifies the offset from the left and top edge of the output image of the first pixel in the image. |
BltY | Specifies the offset from the left and top edge of the output image of the first pixel in the image. |
EFI_SUCCESS | The image was successfully drawn. |
EFI_OUT_OF_RESOURCES | Unable to allocate an output buffer for Blt. |
EFI_INVALID_PARAMETER | The Blt was NULL. |
EFI_NOT_FOUND | The image specified by ImageId is not in the database. The specified PackageList is not in the database. |
EFI_STATUS EFIAPI HiiGetImage | ( | 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 PackageList and copies it into the buffer specified by Image.
This | A pointer to the EFI_HII_IMAGE_PROTOCOL instance. |
PackageList | Handle of the package list where this image will be searched. |
ImageId | The image's id,, which is unique within PackageList. |
Image | Points to the image. |
EFI_SUCCESS | The new image was returned successfully. |
EFI_NOT_FOUND | The image specified by ImageId is not in the database. The specified PackageList is not in the database. |
EFI_BUFFER_TOO_SMALL | The buffer specified by ImageSize is too small to hold the image. |
EFI_INVALID_PARAMETER | The Image or ImageSize was NULL. |
EFI_OUT_OF_RESOURCES | The bitmap could not be retrieved because there was not enough memory. |
EFI_STATUS EFIAPI HiiNewImage | ( | 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 image identifier (ImageId).
This | A pointer to the EFI_HII_IMAGE_PROTOCOL instance. |
PackageList | Handle of the package list where this image will be added. |
ImageId | On return, contains the new image id, which is unique within PackageList. |
Image | Points to the image. |
EFI_SUCCESS | The new image was added successfully. |
EFI_NOT_FOUND | The specified PackageList could not be found in database. |
EFI_OUT_OF_RESOURCES | Could not add the image due to lack of resources. |
EFI_INVALID_PARAMETER | Image is NULL or ImageId is NULL. |
EFI_STATUS EFIAPI HiiSetImage | ( | 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 specified by Image.
This | A pointer to the EFI_HII_IMAGE_PROTOCOL instance. |
PackageList | The package list containing the images. |
ImageId | The image's id,, which is unique within PackageList. |
Image | Points to the image. |
EFI_SUCCESS | The new image was updated successfully. |
EFI_NOT_FOUND | The image specified by ImageId is not in the database. The specified PackageList is not in the database. |
EFI_INVALID_PARAMETER | The Image was NULL. |
EFI_STATUS IGetImage | ( | IN LIST_ENTRY * | Database, |
IN EFI_HII_HANDLE | PackageList, | ||
IN EFI_IMAGE_ID | ImageId, | ||
OUT EFI_IMAGE_INPUT * | Image, | ||
IN BOOLEAN | BitmapOnly | ||
) |
This function retrieves the image specified by ImageId which is associated with the specified PackageList and copies it into the buffer specified by Image.
Database | A pointer to the database list header. |
PackageList | Handle of the package list where this image will be searched. |
ImageId | The image's id,, which is unique within PackageList. |
Image | Points to the image. |
BitmapOnly | TRUE to only return the bitmap type image. FALSE to locate image decoder instance to decode image. |
EFI_SUCCESS | The new image was returned successfully. |
EFI_NOT_FOUND | The image specified by ImageId is not in the database. The specified PackageList is not in the database. |
EFI_BUFFER_TOO_SMALL | The buffer specified by ImageSize is too small to hold the image. |
EFI_INVALID_PARAMETER | The Image or ImageSize was NULL. |
EFI_OUT_OF_RESOURCES | The bitmap could not be retrieved because there was not enough memory. |
EFI_STATUS ImageToBlt | ( | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL * | BltBuffer, |
IN UINTN | BltX, | ||
IN UINTN | BltY, | ||
IN UINTN | Width, | ||
IN UINTN | Height, | ||
IN BOOLEAN | Transparent, | ||
IN OUT EFI_IMAGE_OUTPUT ** | Blt | ||
) |
Convert the image from EFI_IMAGE_INPUT to EFI_IMAGE_OUTPUT format.
This is a internal function.
BltBuffer | Buffer points to bitmap data of incoming image. |
BltX | Specifies the offset from the left and top edge of the output image of the first pixel in the image. |
BltY | Specifies the offset from the left and top edge of the output image of the first pixel in the image. |
Width | Width of the incoming image, in pixels. |
Height | Height of the incoming image, in pixels. |
Transparent | If TRUE, all "off" pixels in the image will be drawn using the pixel value from blt and all other pixels will be copied. |
Blt | Buffer points to bitmap data of output image. |
EFI_SUCCESS | The image was successfully converted. |
EFI_INVALID_PARAMETER | Any incoming parameter is invalid. |
HII_DATABASE_PACKAGE_LIST_INSTANCE * LocatePackageList | ( | IN LIST_ENTRY * | Database, |
IN EFI_HII_HANDLE | PackageList | ||
) |
VOID Output1bitPixel | ( | IN OUT EFI_IMAGE_INPUT * | Image, |
IN UINT8 * | Data, | ||
IN EFI_HII_IMAGE_PALETTE_INFO * | PaletteInfo | ||
) |
Output pixels in "1 bit per pixel" format to an image.
This is a internal function.
Image | Points to the image which will store the pixels. |
Data | Stores the value of output pixels, 0 or 1. |
PaletteInfo | PaletteInfo which stores the color of the output pixels. First entry corresponds to color 0 and second one to color 1. |
VOID Output24bitPixel | ( | IN OUT EFI_IMAGE_INPUT * | Image, |
IN EFI_HII_RGB_PIXEL * | Data | ||
) |
VOID Output4bitPixel | ( | IN OUT EFI_IMAGE_INPUT * | Image, |
IN UINT8 * | Data, | ||
IN EFI_HII_IMAGE_PALETTE_INFO * | PaletteInfo | ||
) |
Output pixels in "4 bit per pixel" format to an image.
This is a internal function.
Image | Points to the image which will store the pixels. | |
Data | Stores the value of output pixels, 0 ~ 15. | |
[in] | PaletteInfo | PaletteInfo which stores the color of the output pixels. Each entry corresponds to a color within [0, 15]. |
VOID Output8bitPixel | ( | IN OUT EFI_IMAGE_INPUT * | Image, |
IN UINT8 * | Data, | ||
IN EFI_HII_IMAGE_PALETTE_INFO * | PaletteInfo | ||
) |
Output pixels in "8 bit per pixel" format to an image.
This is a internal function.
Image | Points to the image which will store the pixels. | |
Data | Stores the value of output pixels, 0 ~ 255. | |
[in] | PaletteInfo | PaletteInfo which stores the color of the output pixels. Each entry corresponds to a color within [0, 255]. |