Hi, all
  This proposal is to add support of HII Image package generation in edk2 
BaseTools.  Like uni file for HII string package, it includes the following 
things. Please help review and raise your comments.

1)      New file type *.idf Image definition file to describe HII image 
resource. It is the ASCII text file, and includes one or more "#image IMAGE_ID 
[TRANSPARENT] ImageFileName".

a.       IMAGE_ID is macro name. IMAGE_TOKEN (IMAGE_ID) is referred in other 
source files.

b.      TRANSPARENT is optional. If it is specified, BaseTools will add TRANS 
image block type for the input ImageFile. UEFI spec doesn't define TRANS JPG 
and PNG block type. So, this flag is ignored for JPG and PNG image.

c.       ImageFileName is also listed in [Sources] section of INF, and its file 
extension is one of .bmp, .jpg, .png (case insensitive).

d.      BaseTools parses idf files and gets every image file, then bases on 
file extension to generate the different image block data, last combine them 
and output HII image package.

                                                               i.      If more 
than one idf files are listed in [Sources] section of one INF, they will be 
merged and parsed.

                                                             ii.      If the 
image file is not found or its file extension is unsupported, BaseTools will 
report build error.

                                                            iii.      If the 
file extension is bmp, BaseTools will convert it convert it to 
EFI_HII_IIBT_IMAGE_BLOCK and EFI_HII_IMAGE_PALETTE_INFO.

                                                           iv.      If the file 
extension is jpg, BaseTools will only check 'JFIF' signature at offset 6 in the 
image file, then add it into EFI_HII_IIBT_JPEG_BLOCK.

                                                             v.      If the 
file extension is  png, BaseTools directly adds it into EFI_HII_IIBT_PNG_BLOCK 
without any check.

2)      New IMAGE_TOKEN macro is used to refer to IMAGE_ID.

3)      New AutoGen header file $(MODULE_NAME)ImgDefs.h to include the 
generated ImageId definition.

4)      New $(MODULE_NAME)Idf.hpk or $(MODULE_NAME)Images are generated as the 
output binary HII image package.

Sample.idf:
#image IMG_LOGO TRANSPARENT  Logo.bmp
#image IMG_FULL_LOGO   Logo.jpg
#image IMG_OEM_LOGO    Logo.png

Thanks
Liming

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to