• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   Library for performing video blt operations
3 
4   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
5   This program and the accompanying materials
6   are licensed and made available under the terms and conditions of the BSD License
7   which accompanies this distribution.  The full text of the license may be found at
8   http://opensource.org/licenses/bsd-license.php
9 
10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #ifndef __BLT_LIB__
16 #define __BLT_LIB__
17 
18 #include <Protocol/GraphicsOutput.h>
19 
20 
21 /**
22   Configure the BltLib for a frame-buffer
23 
24   @param[in] FrameBuffer      Pointer to the start of the frame buffer
25   @param[in] FrameBufferInfo  Describes the frame buffer characteristics
26 
27   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
28   @retval  EFI_SUCCESS - Blt operation success
29 
30 **/
31 EFI_STATUS
32 EFIAPI
33 BltLibConfigure (
34   IN  VOID                                 *FrameBuffer,
35   IN  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo
36   );
37 
38 
39 /**
40   Performs a UEFI Graphics Output Protocol Blt operation.
41 
42   @param[in,out] BltBuffer     - The data to transfer to screen
43   @param[in]     BltOperation  - The operation to perform
44   @param[in]     SourceX       - The X coordinate of the source for BltOperation
45   @param[in]     SourceY       - The Y coordinate of the source for BltOperation
46   @param[in]     DestinationX  - The X coordinate of the destination for BltOperation
47   @param[in]     DestinationY  - The Y coordinate of the destination for BltOperation
48   @param[in]     Width         - The width of a rectangle in the blt rectangle in pixels
49   @param[in]     Height        - The height of a rectangle in the blt rectangle in pixels
50   @param[in]     Delta         - Not used for EfiBltVideoFill and EfiBltVideoToVideo operation.
51                                  If a Delta of 0 is used, the entire BltBuffer will be operated on.
52                                  If a subrectangle of the BltBuffer is used, then Delta represents
53                                  the number of bytes in a row of the BltBuffer.
54 
55   @retval  EFI_DEVICE_ERROR - A hardware error occured
56   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
57   @retval  EFI_SUCCESS - Blt operation success
58 
59 **/
60 EFI_STATUS
61 EFIAPI
62 BltLibGopBlt (
63   IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer, OPTIONAL
64   IN     EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
65   IN     UINTN                              SourceX,
66   IN     UINTN                              SourceY,
67   IN     UINTN                              DestinationX,
68   IN     UINTN                              DestinationY,
69   IN     UINTN                              Width,
70   IN     UINTN                              Height,
71   IN     UINTN                              Delta
72   );
73 
74 
75 /**
76   Performs a UEFI Graphics Output Protocol Blt Video Fill.
77 
78   @param[in]  Color         Color to fill the region with
79   @param[in]  DestinationX  X location to start fill operation
80   @param[in]  DestinationY  Y location to start fill operation
81   @param[in]  Width         Width (in pixels) to fill
82   @param[in]  Height        Height to fill
83 
84   @retval  EFI_DEVICE_ERROR - A hardware error occured
85   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
86   @retval  EFI_SUCCESS - Blt operation success
87 
88 **/
89 EFI_STATUS
90 EFIAPI
91 BltLibVideoFill (
92   IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *Color,
93   IN  UINTN                                 DestinationX,
94   IN  UINTN                                 DestinationY,
95   IN  UINTN                                 Width,
96   IN  UINTN                                 Height
97   );
98 
99 
100 /**
101   Performs a UEFI Graphics Output Protocol Blt Video to Buffer operation.
102 
103   @param[out] BltBuffer     Output buffer for pixel color data
104   @param[in]  SourceX       X location within video
105   @param[in]  SourceY       Y location within video
106   @param[in]  Width         Width (in pixels)
107   @param[in]  Height        Height
108 
109   @retval  EFI_DEVICE_ERROR - A hardware error occured
110   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
111   @retval  EFI_SUCCESS - Blt operation success
112 
113 **/
114 EFI_STATUS
115 EFIAPI
116 BltLibVideoToBltBuffer (
117   OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,
118   IN  UINTN                                 SourceX,
119   IN  UINTN                                 SourceY,
120   IN  UINTN                                 Width,
121   IN  UINTN                                 Height
122   );
123 
124 
125 /**
126   Performs a UEFI Graphics Output Protocol Blt Video to Buffer operation
127   with extended parameters.
128 
129   @param[out] BltBuffer     Output buffer for pixel color data
130   @param[in]  SourceX       X location within video
131   @param[in]  SourceY       Y location within video
132   @param[in]  DestinationX  X location within BltBuffer
133   @param[in]  DestinationY  Y location within BltBuffer
134   @param[in]  Width         Width (in pixels)
135   @param[in]  Height        Height
136   @param[in]  Delta         Number of bytes in a row of BltBuffer
137 
138   @retval  EFI_DEVICE_ERROR - A hardware error occured
139   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
140   @retval  EFI_SUCCESS - Blt operation success
141 
142 **/
143 EFI_STATUS
144 EFIAPI
145 BltLibVideoToBltBufferEx (
146   OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,
147   IN  UINTN                                 SourceX,
148   IN  UINTN                                 SourceY,
149   IN  UINTN                                 DestinationX,
150   IN  UINTN                                 DestinationY,
151   IN  UINTN                                 Width,
152   IN  UINTN                                 Height,
153   IN  UINTN                                 Delta
154   );
155 
156 
157 /**
158   Performs a UEFI Graphics Output Protocol Blt Buffer to Video operation.
159 
160   @param[in]  BltBuffer     Output buffer for pixel color data
161   @param[in]  DestinationX  X location within video
162   @param[in]  DestinationY  Y location within video
163   @param[in]  Width         Width (in pixels)
164   @param[in]  Height        Height
165 
166   @retval  EFI_DEVICE_ERROR - A hardware error occured
167   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
168   @retval  EFI_SUCCESS - Blt operation success
169 
170 **/
171 EFI_STATUS
172 EFIAPI
173 BltLibBufferToVideo (
174   IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,
175   IN  UINTN                                 DestinationX,
176   IN  UINTN                                 DestinationY,
177   IN  UINTN                                 Width,
178   IN  UINTN                                 Height
179   );
180 
181 
182 /**
183   Performs a UEFI Graphics Output Protocol Blt Buffer to Video operation
184   with extended parameters.
185 
186   @param[in]  BltBuffer     Output buffer for pixel color data
187   @param[in]  SourceX       X location within BltBuffer
188   @param[in]  SourceY       Y location within BltBuffer
189   @param[in]  DestinationX  X location within video
190   @param[in]  DestinationY  Y location within video
191   @param[in]  Width         Width (in pixels)
192   @param[in]  Height        Height
193   @param[in]  Delta         Number of bytes in a row of BltBuffer
194 
195   @retval  EFI_DEVICE_ERROR - A hardware error occured
196   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
197   @retval  EFI_SUCCESS - Blt operation success
198 
199 **/
200 EFI_STATUS
201 EFIAPI
202 BltLibBufferToVideoEx (
203   IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,
204   IN  UINTN                                 SourceX,
205   IN  UINTN                                 SourceY,
206   IN  UINTN                                 DestinationX,
207   IN  UINTN                                 DestinationY,
208   IN  UINTN                                 Width,
209   IN  UINTN                                 Height,
210   IN  UINTN                                 Delta
211   );
212 
213 
214 /**
215   Performs a UEFI Graphics Output Protocol Blt Video to Video operation
216 
217   @param[in]  SourceX       X location within video
218   @param[in]  SourceY       Y location within video
219   @param[in]  DestinationX  X location within video
220   @param[in]  DestinationY  Y location within video
221   @param[in]  Width         Width (in pixels)
222   @param[in]  Height        Height
223 
224   @retval  EFI_DEVICE_ERROR - A hardware error occured
225   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
226   @retval  EFI_SUCCESS - Blt operation success
227 
228 **/
229 EFI_STATUS
230 EFIAPI
231 BltLibVideoToVideo (
232   IN  UINTN                                 SourceX,
233   IN  UINTN                                 SourceY,
234   IN  UINTN                                 DestinationX,
235   IN  UINTN                                 DestinationY,
236   IN  UINTN                                 Width,
237   IN  UINTN                                 Height
238   );
239 
240 
241 /**
242   Returns the sizes related to the video device
243 
244   @param[out]  Width   Width (in pixels)
245   @param[out]  Height  Height (in pixels)
246 
247   @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
248   @retval  EFI_SUCCESS - The sizes were returned
249 
250 **/
251 EFI_STATUS
252 EFIAPI
253 BltLibGetSizes (
254   OUT UINTN                                 *Width,  OPTIONAL
255   OUT UINTN                                 *Height  OPTIONAL
256   );
257 
258 #endif
259 
260