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