/** @file1UGA Draw protocol from the EFI 1.1 specification.23Abstraction of a very simple graphics device.45Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>67This program and the accompanying materials are licensed and made available8under the terms and conditions of the BSD License which accompanies this9distribution. The full text of the license may be found at:10http://opensource.org/licenses/bsd-license.php1112THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.1415File name: UgaDraw.h1617**/1819#ifndef __UGA_DRAW_H__20#define __UGA_DRAW_H__2122#define EFI_UGA_DRAW_PROTOCOL_GUID \23{ 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39} }2425typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;2627/**28Return the current video mode information.2930@param This Protocol instance pointer.31@param HorizontalResolution Current video horizontal resolution in pixels32@param VerticalResolution Current video vertical resolution in pixels33@param ColorDepth Current video color depth in bits per pixel34@param RefreshRate Current video refresh rate in Hz.3536@retval EFI_SUCCESS Mode information returned.37@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()38@retval EFI_INVALID_PARAMETER One of the input args was NULL.3940**/41typedef42EFI_STATUS43(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (44IN EFI_UGA_DRAW_PROTOCOL *This,45OUT UINT32 *HorizontalResolution,46OUT UINT32 *VerticalResolution,47OUT UINT32 *ColorDepth,48OUT UINT32 *RefreshRate49)50;5152/**53Return the current video mode information.5455@param This Protocol instance pointer.56@param HorizontalResolution Current video horizontal resolution in pixels57@param VerticalResolution Current video vertical resolution in pixels58@param ColorDepth Current video color depth in bits per pixel59@param RefreshRate Current video refresh rate in Hz.6061@retval EFI_SUCCESS Mode information returned.62@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()6364**/65typedef66EFI_STATUS67(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (68IN EFI_UGA_DRAW_PROTOCOL *This,69IN UINT32 HorizontalResolution,70IN UINT32 VerticalResolution,71IN UINT32 ColorDepth,72IN UINT32 RefreshRate73)74;7576typedef struct {77UINT8 Blue;78UINT8 Green;79UINT8 Red;80UINT8 Reserved;81} EFI_UGA_PIXEL;8283typedef union {84EFI_UGA_PIXEL Pixel;85UINT32 Raw;86} EFI_UGA_PIXEL_UNION;8788typedef enum {89EfiUgaVideoFill,90EfiUgaVideoToBltBuffer,91EfiUgaBltBufferToVideo,92EfiUgaVideoToVideo,93EfiUgaBltMax94} EFI_UGA_BLT_OPERATION;9596/**97Type specifying a pointer to a function to perform an UGA Blt operation.9899The following table defines actions for BltOperations:100101<B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)102directly to every pixel of the video display rectangle103(DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).104Only one pixel will be used from the BltBuffer. Delta is NOT used.105106<B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle107(SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in108the BltBuffer rectangle (DestinationX, DestinationY )109(DestinationX + Width, DestinationY + Height). If DestinationX or110DestinationY is not zero then Delta must be set to the length in bytes111of a row in the BltBuffer.112113<B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle114(SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the115video display rectangle (DestinationX, DestinationY)116(DestinationX + Width, DestinationY + Height). If SourceX or SourceY is117not zero then Delta must be set to the length in bytes of a row in the118BltBuffer.119120<B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)121(SourceX + Width, SourceY + Height) .to the video display rectangle122(DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).123The BltBuffer and Delta are not used in this mode.124125126@param[in] This - Protocol instance pointer.127@param[in] BltBuffer - Buffer containing data to blit into video buffer. This128buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)129@param[in] BltOperation - Operation to perform on BlitBuffer and video memory130@param[in] SourceX - X coordinate of source for the BltBuffer.131@param[in] SourceY - Y coordinate of source for the BltBuffer.132@param[in] DestinationX - X coordinate of destination for the BltBuffer.133@param[in] DestinationY - Y coordinate of destination for the BltBuffer.134@param[in] Width - Width of rectangle in BltBuffer in pixels.135@param[in] Height - Hight of rectangle in BltBuffer in pixels.136@param[in] Delta - OPTIONAL137138@retval EFI_SUCCESS - The Blt operation completed.139@retval EFI_INVALID_PARAMETER - BltOperation is not valid.140@retval EFI_DEVICE_ERROR - A hardware error occurred writing to the video buffer.141142--*/143typedef144EFI_STATUS145(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (146IN EFI_UGA_DRAW_PROTOCOL * This,147IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL148IN EFI_UGA_BLT_OPERATION BltOperation,149IN UINTN SourceX,150IN UINTN SourceY,151IN UINTN DestinationX,152IN UINTN DestinationY,153IN UINTN Width,154IN UINTN Height,155IN UINTN Delta OPTIONAL156);157158struct _EFI_UGA_DRAW_PROTOCOL {159EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;160EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;161EFI_UGA_DRAW_PROTOCOL_BLT Blt;162};163164extern EFI_GUID gEfiUgaDrawProtocolGuid;165166#endif167168169