]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/BmpSupportLib.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Library / BmpSupportLib.h
CommitLineData
4123d6da
KM
1/** @file\r
2\r
3Provides services to convert a BMP graphics image to a GOP BLT buffer\r
4and to convert a GOP BLT buffer to a BMP graphics image.\r
5\r
6Copyright (c) 2016, Microsoft Corporation\r
7Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
8\r
9All rights reserved.\r
9d510e61 10SPDX-License-Identifier: BSD-2-Clause-Patent\r
4123d6da
KM
11\r
12**/\r
13\r
14#ifndef __BMP_SUPPORT_LIB_H__\r
15#define __BMP_SUPPORT_LIB_H__\r
16\r
17#include <Protocol/GraphicsOutput.h>\r
18\r
19/**\r
20 Translate a *.BMP graphics image to a GOP blt buffer. If a NULL Blt buffer\r
21 is passed in a GopBlt buffer will be allocated by this routine using\r
22 EFI_BOOT_SERVICES.AllocatePool(). If a GopBlt buffer is passed in it will be\r
23 used if it is big enough.\r
24\r
25 @param [in] BmpImage Pointer to BMP file.\r
26 @param [in] BmpImageSize Number of bytes in BmpImage.\r
27 @param [in, out] GopBlt Buffer containing GOP version of BmpImage.\r
28 @param [in, out] GopBltSize Size of GopBlt in bytes.\r
29 @param [out] PixelHeight Height of GopBlt/BmpImage in pixels.\r
30 @param [out] PixelWidth Width of GopBlt/BmpImage in pixels.\r
31\r
32 @retval RETURN_SUCCESS GopBlt and GopBltSize are returned.\r
33 @retval RETURN_INVALID_PARAMETER BmpImage is NULL.\r
34 @retval RETURN_INVALID_PARAMETER GopBlt is NULL.\r
35 @retval RETURN_INVALID_PARAMETER GopBltSize is NULL.\r
36 @retval RETURN_INVALID_PARAMETER PixelHeight is NULL.\r
37 @retval RETURN_INVALID_PARAMETER PixelWidth is NULL.\r
38 @retval RETURN_UNSUPPORTED BmpImage is not a valid *.BMP image.\r
39 @retval RETURN_BUFFER_TOO_SMALL The passed in GopBlt buffer is not big\r
40 enough. The required size is returned in\r
41 GopBltSize.\r
42 @retval RETURN_OUT_OF_RESOURCES The GopBlt buffer could not be allocated.\r
43\r
44**/\r
45RETURN_STATUS\r
46EFIAPI\r
47TranslateBmpToGopBlt (\r
48 IN VOID *BmpImage,\r
49 IN UINTN BmpImageSize,\r
50 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,\r
51 IN OUT UINTN *GopBltSize,\r
52 OUT UINTN *PixelHeight,\r
53 OUT UINTN *PixelWidth\r
54 );\r
55\r
56/**\r
57 Translate a GOP blt buffer to an uncompressed 24-bit per pixel BMP graphics\r
58 image. If a NULL BmpImage is passed in a BmpImage buffer will be allocated by\r
59 this routine using EFI_BOOT_SERVICES.AllocatePool(). If a BmpImage buffer is\r
60 passed in it will be used if it is big enough.\r
61\r
62 @param [in] GopBlt Pointer to GOP blt buffer.\r
63 @param [in] PixelHeight Height of GopBlt/BmpImage in pixels.\r
64 @param [in] PixelWidth Width of GopBlt/BmpImage in pixels.\r
65 @param [in, out] BmpImage Buffer containing BMP version of GopBlt.\r
66 @param [in, out] BmpImageSize Size of BmpImage in bytes.\r
67\r
68 @retval RETURN_SUCCESS BmpImage and BmpImageSize are returned.\r
69 @retval RETURN_INVALID_PARAMETER GopBlt is NULL.\r
70 @retval RETURN_INVALID_PARAMETER BmpImage is NULL.\r
71 @retval RETURN_INVALID_PARAMETER BmpImageSize is NULL.\r
72 @retval RETURN_UNSUPPORTED GopBlt cannot be converted to a *.BMP image.\r
73 @retval RETURN_BUFFER_TOO_SMALL The passed in BmpImage buffer is not big\r
74 enough. The required size is returned in\r
75 BmpImageSize.\r
76 @retval RETURN_OUT_OF_RESOURCES The BmpImage buffer could not be allocated.\r
77\r
78**/\r
79RETURN_STATUS\r
80EFIAPI\r
81TranslateGopBltToBmp (\r
82 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GopBlt,\r
83 IN UINT32 PixelHeight,\r
84 IN UINT32 PixelWidth,\r
85 IN OUT VOID **BmpImage,\r
86 IN OUT UINT32 *BmpImageSize\r
87 );\r
88\r
89#endif\r