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