BltLib.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /** @file
  2. Library for performing video blt operations
  3. Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __BLT_LIB__
  7. #define __BLT_LIB__
  8. #include <Protocol/GraphicsOutput.h>
  9. /**
  10. Configure the BltLib for a frame-buffer
  11. @param[in] FrameBuffer Pointer to the start of the frame buffer
  12. @param[in] FrameBufferInfo Describes the frame buffer characteristics
  13. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  14. @retval EFI_SUCCESS - Blt operation success
  15. **/
  16. EFI_STATUS
  17. EFIAPI
  18. BltLibConfigure (
  19. IN VOID *FrameBuffer,
  20. IN EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo
  21. );
  22. /**
  23. Performs a UEFI Graphics Output Protocol Blt operation.
  24. @param[in,out] BltBuffer - The data to transfer to screen
  25. @param[in] BltOperation - The operation to perform
  26. @param[in] SourceX - The X coordinate of the source for BltOperation
  27. @param[in] SourceY - The Y coordinate of the source for BltOperation
  28. @param[in] DestinationX - The X coordinate of the destination for BltOperation
  29. @param[in] DestinationY - The Y coordinate of the destination for BltOperation
  30. @param[in] Width - The width of a rectangle in the blt rectangle in pixels
  31. @param[in] Height - The height of a rectangle in the blt rectangle in pixels
  32. @param[in] Delta - Not used for EfiBltVideoFill and EfiBltVideoToVideo operation.
  33. If a Delta of 0 is used, the entire BltBuffer will be operated on.
  34. If a subrectangle of the BltBuffer is used, then Delta represents
  35. the number of bytes in a row of the BltBuffer.
  36. @retval EFI_DEVICE_ERROR - A hardware error occured
  37. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  38. @retval EFI_SUCCESS - Blt operation success
  39. **/
  40. EFI_STATUS
  41. EFIAPI
  42. BltLibGopBlt (
  43. IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
  44. IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
  45. IN UINTN SourceX,
  46. IN UINTN SourceY,
  47. IN UINTN DestinationX,
  48. IN UINTN DestinationY,
  49. IN UINTN Width,
  50. IN UINTN Height,
  51. IN UINTN Delta
  52. );
  53. /**
  54. Performs a UEFI Graphics Output Protocol Blt Video Fill.
  55. @param[in] Color Color to fill the region with
  56. @param[in] DestinationX X location to start fill operation
  57. @param[in] DestinationY Y location to start fill operation
  58. @param[in] Width Width (in pixels) to fill
  59. @param[in] Height Height to fill
  60. @retval EFI_DEVICE_ERROR - A hardware error occured
  61. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  62. @retval EFI_SUCCESS - Blt operation success
  63. **/
  64. EFI_STATUS
  65. EFIAPI
  66. BltLibVideoFill (
  67. IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Color,
  68. IN UINTN DestinationX,
  69. IN UINTN DestinationY,
  70. IN UINTN Width,
  71. IN UINTN Height
  72. );
  73. /**
  74. Performs a UEFI Graphics Output Protocol Blt Video to Buffer operation.
  75. @param[out] BltBuffer Output buffer for pixel color data
  76. @param[in] SourceX X location within video
  77. @param[in] SourceY Y location within video
  78. @param[in] Width Width (in pixels)
  79. @param[in] Height Height
  80. @retval EFI_DEVICE_ERROR - A hardware error occured
  81. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  82. @retval EFI_SUCCESS - Blt operation success
  83. **/
  84. EFI_STATUS
  85. EFIAPI
  86. BltLibVideoToBltBuffer (
  87. OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
  88. IN UINTN SourceX,
  89. IN UINTN SourceY,
  90. IN UINTN Width,
  91. IN UINTN Height
  92. );
  93. /**
  94. Performs a UEFI Graphics Output Protocol Blt Video to Buffer operation
  95. with extended parameters.
  96. @param[out] BltBuffer Output buffer for pixel color data
  97. @param[in] SourceX X location within video
  98. @param[in] SourceY Y location within video
  99. @param[in] DestinationX X location within BltBuffer
  100. @param[in] DestinationY Y location within BltBuffer
  101. @param[in] Width Width (in pixels)
  102. @param[in] Height Height
  103. @param[in] Delta Number of bytes in a row of BltBuffer
  104. @retval EFI_DEVICE_ERROR - A hardware error occured
  105. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  106. @retval EFI_SUCCESS - Blt operation success
  107. **/
  108. EFI_STATUS
  109. EFIAPI
  110. BltLibVideoToBltBufferEx (
  111. OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
  112. IN UINTN SourceX,
  113. IN UINTN SourceY,
  114. IN UINTN DestinationX,
  115. IN UINTN DestinationY,
  116. IN UINTN Width,
  117. IN UINTN Height,
  118. IN UINTN Delta
  119. );
  120. /**
  121. Performs a UEFI Graphics Output Protocol Blt Buffer to Video operation.
  122. @param[in] BltBuffer Output buffer for pixel color data
  123. @param[in] DestinationX X location within video
  124. @param[in] DestinationY Y location within video
  125. @param[in] Width Width (in pixels)
  126. @param[in] Height Height
  127. @retval EFI_DEVICE_ERROR - A hardware error occured
  128. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  129. @retval EFI_SUCCESS - Blt operation success
  130. **/
  131. EFI_STATUS
  132. EFIAPI
  133. BltLibBufferToVideo (
  134. IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
  135. IN UINTN DestinationX,
  136. IN UINTN DestinationY,
  137. IN UINTN Width,
  138. IN UINTN Height
  139. );
  140. /**
  141. Performs a UEFI Graphics Output Protocol Blt Buffer to Video operation
  142. with extended parameters.
  143. @param[in] BltBuffer Output buffer for pixel color data
  144. @param[in] SourceX X location within BltBuffer
  145. @param[in] SourceY Y location within BltBuffer
  146. @param[in] DestinationX X location within video
  147. @param[in] DestinationY Y location within video
  148. @param[in] Width Width (in pixels)
  149. @param[in] Height Height
  150. @param[in] Delta Number of bytes in a row of BltBuffer
  151. @retval EFI_DEVICE_ERROR - A hardware error occured
  152. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  153. @retval EFI_SUCCESS - Blt operation success
  154. **/
  155. EFI_STATUS
  156. EFIAPI
  157. BltLibBufferToVideoEx (
  158. IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
  159. IN UINTN SourceX,
  160. IN UINTN SourceY,
  161. IN UINTN DestinationX,
  162. IN UINTN DestinationY,
  163. IN UINTN Width,
  164. IN UINTN Height,
  165. IN UINTN Delta
  166. );
  167. /**
  168. Performs a UEFI Graphics Output Protocol Blt Video to Video operation
  169. @param[in] SourceX X location within video
  170. @param[in] SourceY Y location within video
  171. @param[in] DestinationX X location within video
  172. @param[in] DestinationY Y location within video
  173. @param[in] Width Width (in pixels)
  174. @param[in] Height Height
  175. @retval EFI_DEVICE_ERROR - A hardware error occured
  176. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  177. @retval EFI_SUCCESS - Blt operation success
  178. **/
  179. EFI_STATUS
  180. EFIAPI
  181. BltLibVideoToVideo (
  182. IN UINTN SourceX,
  183. IN UINTN SourceY,
  184. IN UINTN DestinationX,
  185. IN UINTN DestinationY,
  186. IN UINTN Width,
  187. IN UINTN Height
  188. );
  189. /**
  190. Returns the sizes related to the video device
  191. @param[out] Width Width (in pixels)
  192. @param[out] Height Height (in pixels)
  193. @retval EFI_INVALID_PARAMETER - Invalid parameter passed in
  194. @retval EFI_SUCCESS - The sizes were returned
  195. **/
  196. EFI_STATUS
  197. EFIAPI
  198. BltLibGetSizes (
  199. OUT UINTN *Width, OPTIONAL
  200. OUT UINTN *Height OPTIONAL
  201. );
  202. #endif