]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UgaDraw.h
automagically convert ELF to PE/COFF (i386 only)
[mirror_edk2.git] / MdePkg / Include / Protocol / UgaDraw.h
CommitLineData
878ddf1f 1/** @file\r
2 UGA Draw protocol from the EFI 1.1 specification.\r
3\r
4 Abstraction of a very simple graphics device.\r
5\r
6 Copyright (c) 2006, Intel Corporation \r
7 All rights reserved. This program and the accompanying materials \r
8 are licensed and made available under the terms and conditions of the BSD License \r
9 which accompanies this distribution. The full text of the license may be found at \r
10 http://opensource.org/licenses/bsd-license.php \r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
15 Module Name: UgaDraw.h\r
16\r
17**/\r
18\r
19#ifndef __UGA_DRAW_H__\r
20#define __UGA_DRAW_H__\r
21\r
22#define EFI_UGA_DRAW_PROTOCOL_GUID \\r
23 { \\r
24 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \\r
25 }\r
26\r
27typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;\r
28\r
29/**\r
30 Return the current video mode information.\r
31\r
32 @param This Protocol instance pointer.\r
33 @param HorizontalResolution Current video horizontal resolution in pixels\r
34 @param VerticalResolution Current video vertical resolution in pixels\r
35 @param ColorDepth Current video color depth in bits per pixel\r
36 @param RefreshRate Current video refresh rate in Hz.\r
37\r
38 @retval EFI_SUCCESS Mode information returned.\r
39 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
40 @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
41\r
42**/\r
43typedef\r
44EFI_STATUS\r
45(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (\r
46 IN EFI_UGA_DRAW_PROTOCOL *This,\r
47 OUT UINT32 *HorizontalResolution,\r
48 OUT UINT32 *VerticalResolution,\r
49 OUT UINT32 *ColorDepth,\r
50 OUT UINT32 *RefreshRate\r
51 )\r
52;\r
53\r
54/**\r
55 Return the current video mode information.\r
56\r
57 @param This Protocol instance pointer.\r
58 @param HorizontalResolution Current video horizontal resolution in pixels\r
59 @param VerticalResolution Current video vertical resolution in pixels\r
60 @param ColorDepth Current video color depth in bits per pixel\r
61 @param RefreshRate Current video refresh rate in Hz.\r
62\r
63 @retval EFI_SUCCESS Mode information returned.\r
64 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
65\r
66**/\r
67typedef\r
68EFI_STATUS\r
69(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (\r
70 IN EFI_UGA_DRAW_PROTOCOL *This,\r
71 IN UINT32 HorizontalResolution,\r
72 IN UINT32 VerticalResolution,\r
73 IN UINT32 ColorDepth,\r
74 IN UINT32 RefreshRate\r
75 )\r
76;\r
77\r
78typedef struct {\r
79 UINT8 Blue;\r
80 UINT8 Green;\r
81 UINT8 Red;\r
82 UINT8 Reserved;\r
83} EFI_UGA_PIXEL;\r
84\r
85typedef union {\r
86 EFI_UGA_PIXEL Pixel;\r
87 UINT32 Raw;\r
88} EFI_UGA_PIXEL_UNION;\r
89\r
90typedef enum {\r
91 EfiUgaVideoFill,\r
92 EfiUgaVideoToBltBuffer,\r
93 EfiUgaBltBufferToVideo,\r
94 EfiUgaVideoToVideo,\r
95 EfiUgaBltMax\r
96} EFI_UGA_BLT_OPERATION;\r
97\r
98/**\r
99 Type specifying a pointer to a function to perform an UGA Blt operation.\r
100\r
101 The following table defines actions for BltOperations:\r
102\r
103 <B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY) \r
104 directly to every pixel of the video display rectangle \r
105 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
106 Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
107\r
108 <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle \r
109 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in \r
110 the BltBuffer rectangle (DestinationX, DestinationY ) \r
111 (DestinationX + Width, DestinationY + Height). If DestinationX or \r
112 DestinationY is not zero then Delta must be set to the length in bytes \r
113 of a row in the BltBuffer.\r
114\r
115 <B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle \r
116 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the \r
117 video display rectangle (DestinationX, DestinationY) \r
118 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is \r
119 not zero then Delta must be set to the length in bytes of a row in the \r
120 BltBuffer.\r
121\r
122 <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)\r
123 (SourceX + Width, SourceY + Height) .to the video display rectangle \r
124 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
125 The BltBuffer and Delta are not used in this mode.\r
126\r
127\r
128 @param[in] This - Protocol instance pointer.\r
129 @param[in] BltBuffer - Buffer containing data to blit into video buffer. This \r
130 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r
131 @param[in] BltOperation - Operation to perform on BlitBuffer and video memory\r
132 @param[in] SourceX - X coordinate of source for the BltBuffer.\r
133 @param[in] SourceY - Y coordinate of source for the BltBuffer.\r
134 @param[in] DestinationX - X coordinate of destination for the BltBuffer.\r
135 @param[in] DestinationY - Y coordinate of destination for the BltBuffer.\r
136 @param[in] Width - Width of rectangle in BltBuffer in pixels.\r
137 @param[in] Height - Hight of rectangle in BltBuffer in pixels.\r
138 @param[in] Delta - OPTIONAL\r
139 \r
140 @retval EFI_SUCCESS - The Blt operation completed.\r
141 @retval EFI_INVALID_PARAMETER - BltOperation is not valid.\r
142 @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.\r
143\r
144--*/\r
145typedef\r
146EFI_STATUS\r
147(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (\r
148 IN EFI_UGA_DRAW_PROTOCOL * This,\r
149 IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL\r
150 IN EFI_UGA_BLT_OPERATION BltOperation,\r
151 IN UINTN SourceX,\r
152 IN UINTN SourceY,\r
153 IN UINTN DestinationX,\r
154 IN UINTN DestinationY,\r
155 IN UINTN Width,\r
156 IN UINTN Height,\r
157 IN UINTN Delta OPTIONAL\r
158 );\r
159\r
160struct _EFI_UGA_DRAW_PROTOCOL {\r
161 EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;\r
162 EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;\r
163 EFI_UGA_DRAW_PROTOCOL_BLT Blt;\r
164};\r
165\r
166extern EFI_GUID gEfiUgaDrawProtocolGuid;\r
167\r
168#endif\r