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