]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/BmpSupportLib.h
MdeModulePkg/S3SmmInitDone.h: Fix copyright coding style error.
[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 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions are met:
12 1. Redistributions of source code must retain the above copyright notice,
13 this list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
17
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 **/
30
31 #ifndef __BMP_SUPPORT_LIB_H__
32 #define __BMP_SUPPORT_LIB_H__
33
34 #include <Protocol/GraphicsOutput.h>
35
36 /**
37 Translate a *.BMP graphics image to a GOP blt buffer. If a NULL Blt buffer
38 is passed in a GopBlt buffer will be allocated by this routine using
39 EFI_BOOT_SERVICES.AllocatePool(). If a GopBlt buffer is passed in it will be
40 used if it is big enough.
41
42 @param [in] BmpImage Pointer to BMP file.
43 @param [in] BmpImageSize Number of bytes in BmpImage.
44 @param [in, out] GopBlt Buffer containing GOP version of BmpImage.
45 @param [in, out] GopBltSize Size of GopBlt in bytes.
46 @param [out] PixelHeight Height of GopBlt/BmpImage in pixels.
47 @param [out] PixelWidth Width of GopBlt/BmpImage in pixels.
48
49 @retval RETURN_SUCCESS GopBlt and GopBltSize are returned.
50 @retval RETURN_INVALID_PARAMETER BmpImage is NULL.
51 @retval RETURN_INVALID_PARAMETER GopBlt is NULL.
52 @retval RETURN_INVALID_PARAMETER GopBltSize is NULL.
53 @retval RETURN_INVALID_PARAMETER PixelHeight is NULL.
54 @retval RETURN_INVALID_PARAMETER PixelWidth is NULL.
55 @retval RETURN_UNSUPPORTED BmpImage is not a valid *.BMP image.
56 @retval RETURN_BUFFER_TOO_SMALL The passed in GopBlt buffer is not big
57 enough. The required size is returned in
58 GopBltSize.
59 @retval RETURN_OUT_OF_RESOURCES The GopBlt buffer could not be allocated.
60
61 **/
62 RETURN_STATUS
63 EFIAPI
64 TranslateBmpToGopBlt (
65 IN VOID *BmpImage,
66 IN UINTN BmpImageSize,
67 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,
68 IN OUT UINTN *GopBltSize,
69 OUT UINTN *PixelHeight,
70 OUT UINTN *PixelWidth
71 );
72
73 /**
74 Translate a GOP blt buffer to an uncompressed 24-bit per pixel BMP graphics
75 image. If a NULL BmpImage is passed in a BmpImage buffer will be allocated by
76 this routine using EFI_BOOT_SERVICES.AllocatePool(). If a BmpImage buffer is
77 passed in it will be used if it is big enough.
78
79 @param [in] GopBlt Pointer to GOP blt buffer.
80 @param [in] PixelHeight Height of GopBlt/BmpImage in pixels.
81 @param [in] PixelWidth Width of GopBlt/BmpImage in pixels.
82 @param [in, out] BmpImage Buffer containing BMP version of GopBlt.
83 @param [in, out] BmpImageSize Size of BmpImage in bytes.
84
85 @retval RETURN_SUCCESS BmpImage and BmpImageSize are returned.
86 @retval RETURN_INVALID_PARAMETER GopBlt is NULL.
87 @retval RETURN_INVALID_PARAMETER BmpImage is NULL.
88 @retval RETURN_INVALID_PARAMETER BmpImageSize is NULL.
89 @retval RETURN_UNSUPPORTED GopBlt cannot be converted to a *.BMP image.
90 @retval RETURN_BUFFER_TOO_SMALL The passed in BmpImage buffer is not big
91 enough. The required size is returned in
92 BmpImageSize.
93 @retval RETURN_OUT_OF_RESOURCES The BmpImage buffer could not be allocated.
94
95 **/
96 RETURN_STATUS
97 EFIAPI
98 TranslateGopBltToBmp (
99 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GopBlt,
100 IN UINT32 PixelHeight,
101 IN UINT32 PixelWidth,
102 IN OUT VOID **BmpImage,
103 IN OUT UINT32 *BmpImageSize
104 );
105
106 #endif