summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Include
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2015-11-18 08:51:42 +0000
committervanjeff <vanjeff@Edk2>2015-11-18 08:51:42 +0000
commit6aaf1ccb97ea99817ca27600289e47d25acf9615 (patch)
tree7d6a763f6c63b245f97297937a4f92922b24e967 /MdeModulePkg/Include
parent25e3b3522b9a5028002e8fc1c5a5b6915b9709f7 (diff)
downloadedk2-platforms-6aaf1ccb97ea99817ca27600289e47d25acf9615.tar.xz
MdeModulePkg: Add ImageDecoderLib to provide image decoding service.
The library itself doesn't provide any image decoding capabilities but manages the different image decoders. (Sync patch r18770 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18880 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Include')
-rw-r--r--MdeModulePkg/Include/Library/ImageDecoderLib.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/Library/ImageDecoderLib.h b/MdeModulePkg/Include/Library/ImageDecoderLib.h
new file mode 100644
index 0000000000..928a09483a
--- /dev/null
+++ b/MdeModulePkg/Include/Library/ImageDecoderLib.h
@@ -0,0 +1,76 @@
+/** @file
+ This library provides image decoding service by managing the different
+ image decoding libraries.
+
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#ifndef __IMAGE_DECODER_LIB_H__
+#define __IMAGE_DECODER_LIB_H__
+#include <Protocol/PlatformLogo.h>
+
+typedef
+EFI_STATUS
+(EFIAPI *DECODE_IMAGE)(
+ IN IMAGE_FORMAT ImageFormat,
+ IN UINT8 *Image,
+ IN UINTN ImageSize,
+ OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,
+ OUT UINTN *GopBltSize,
+ OUT UINTN *PixelWidth,
+ OUT UINTN *PixelHeight
+ );
+
+/**
+ Convert a graphics image to a callee allocated GOP blt buffer.
+
+ @param ImageFormat Format of the image file.
+ @param Image Pointer to image file.
+ @param ImageSize Number of bytes in Image.
+ @param GopBlt Buffer containing GOP version of Image.
+ @param GopBltSize Size of GopBlt in bytes.
+ @param PixelWidth Width of GopBlt/Image in pixels.
+ @param PixelHeight Height of GopBlt/Image in pixels.
+
+ @retval EFI_SUCCESS GopBlt and GopBltSize are returned.
+ @retval EFI_INVALID_PARAMETER GopBlt or GopBltSize is NULL.
+ @retval EFI_INVALID_PARAMETER Image is NULL or ImageSize is 0.
+ @retval EFI_UNSUPPORTED Image is not supported.
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate.
+
+**/
+EFI_STATUS
+EFIAPI
+DecodeImage (
+ IN IMAGE_FORMAT ImageFormat,
+ IN UINT8 *Image,
+ IN UINTN ImageSize,
+ OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,
+ OUT UINTN *GopBltSize,
+ OUT UINTN *PixelWidth,
+ OUT UINTN *PixelHeight
+ );
+
+/**
+ Register an image decoder.
+
+ @param Decoder An image decoder.
+
+ @retval EFI_SUCCESS The decoder was successfully registered.
+ @retval EFI_OUT_OF_RESOURCES No enough resource to register the decoder.
+
+**/
+EFI_STATUS
+EFIAPI
+RegisterImageDecoder (
+ IN DECODE_IMAGE Decoder
+ );
+
+#endif