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