]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/ImageDecoderLib.h
MdeModulePkg: Add ImageDecoderLib to provide image decoding service.
[mirror_edk2.git] / MdeModulePkg / Include / Library / ImageDecoderLib.h
1 /** @file
2 This library provides image decoding service by managing the different
3 image decoding libraries.
4
5 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15 #ifndef __IMAGE_DECODER_LIB_H__
16 #define __IMAGE_DECODER_LIB_H__
17 #include <Protocol/PlatformLogo.h>
18
19 typedef
20 EFI_STATUS
21 (EFIAPI *DECODE_IMAGE)(
22 IN IMAGE_FORMAT ImageFormat,
23 IN UINT8 *Image,
24 IN UINTN ImageSize,
25 OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,
26 OUT UINTN *GopBltSize,
27 OUT UINTN *PixelWidth,
28 OUT UINTN *PixelHeight
29 );
30
31 /**
32 Convert a graphics image to a callee allocated GOP blt buffer.
33
34 @param ImageFormat Format of the image file.
35 @param Image Pointer to image file.
36 @param ImageSize Number of bytes in Image.
37 @param GopBlt Buffer containing GOP version of Image.
38 @param GopBltSize Size of GopBlt in bytes.
39 @param PixelWidth Width of GopBlt/Image in pixels.
40 @param PixelHeight Height of GopBlt/Image in pixels.
41
42 @retval EFI_SUCCESS GopBlt and GopBltSize are returned.
43 @retval EFI_INVALID_PARAMETER GopBlt or GopBltSize is NULL.
44 @retval EFI_INVALID_PARAMETER Image is NULL or ImageSize is 0.
45 @retval EFI_UNSUPPORTED Image is not supported.
46 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate.
47
48 **/
49 EFI_STATUS
50 EFIAPI
51 DecodeImage (
52 IN IMAGE_FORMAT ImageFormat,
53 IN UINT8 *Image,
54 IN UINTN ImageSize,
55 OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,
56 OUT UINTN *GopBltSize,
57 OUT UINTN *PixelWidth,
58 OUT UINTN *PixelHeight
59 );
60
61 /**
62 Register an image decoder.
63
64 @param Decoder An image decoder.
65
66 @retval EFI_SUCCESS The decoder was successfully registered.
67 @retval EFI_OUT_OF_RESOURCES No enough resource to register the decoder.
68
69 **/
70 EFI_STATUS
71 EFIAPI
72 RegisterImageDecoder (
73 IN DECODE_IMAGE Decoder
74 );
75
76 #endif