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