1 /* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef _HI_API_TDE2_H_ 17 #define _HI_API_TDE2_H_ 18 19 #include "hi_type.h" 20 #include "hi_tde_type.h" 21 22 #ifdef __cplusplus 23 #if __cplusplus 24 extern "C" { 25 #endif /* __cplusplus */ 26 #endif /* __cplusplus */ 27 28 #define HI_TDE_Open HI_TDE2_Open 29 #define HI_TDE_Close HI_TDE2_Close 30 #define HI_TDE_BeginJob HI_TDE2_BeginJob 31 32 HI_S32 HI_TDE2_Open(HI_VOID); 33 34 HI_VOID HI_TDE2_Close(HI_VOID); 35 36 TDE_HANDLE HI_TDE2_BeginJob(HI_VOID); 37 38 /* 39 * \brief Submits an existing TDE task. 40 * \attention \n 41 * Before calling this API, you must call HI_TDE2_Open to start a TDE device and call HI_TDE2_BeginJob \n 42 * to obtain a valid task handle. If the calling mode is set to block mode, and the API is returned due \n 43 * to timeout or interruption, the operation continues till it is complete even though the API \n 44 * called by the TDE is returned in advance.\n 45 * The synchronization mode is not supported currently.\n 46 * After a task is submitted, its handle becomes invalid. If the task is submitted again, \n 47 * the error code HI_ERR_TDE_INVALID_HANDLE is returned. \n. 48 * \param[in] s32Handle Handle of a TDE task. 49 * \param[in] bSync Whether to submit a TDE task in synchronization mode. 50 * \param[in] bBlock Block flag. 51 * \param[in] u32TimeOut Timeout period 10 ms. 52 * \retval ::HI_SUCCESS A task is submitted successfully in non-block mode. 53 * \retval ::HI_ERR_TDE_INVALID_HANDLE The input task handle is invalid. 54 * \retval ::HI_ERR_TDE_JOB_TIMEOUT A task is not completed due to timeout. 55 * \see \n 56 * N/A 57 */ 58 HI_S32 HI_TDE2_EndJob(TDE_HANDLE s32Handle, HI_BOOL bSync, HI_BOOL bBlock, HI_U32 u32TimeOut); 59 60 /* 61 * \brief Cancels an operation added in a TDE task. 62 * \attention \n 63 * Before calling this API, you must call HI_TDE2_Open to start a TDE device and \n 64 * call HI_TDE2_BeginJob to obtain a valid task handle.\n 65 * A submitted task cannot be cancelled.\n 66 * No operations can be added to cancelled tasks, because the cancelled tasks are invalid.\n 67 * This API is called when an error occurs during TDE operation configuration.\n 68 * \param[in] s32Handle Handle of a TDE task. 69 * \retval 0 success. 70 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 71 * \retval ::HI_FAILURE The specified task cannot be cancelled because it has been submitted. 72 * \see \n 73 * N/A 74 */ 75 HI_S32 HI_TDE2_CancelJob(TDE_HANDLE s32Handle); 76 77 /* 78 * \brief Waits for the completion of a specified TDE task. 79 * \attention \n 80 * As a block interface, this API is blocked until the specified task is complete.\n 81 * \param[in] s32Handle Handle of a TDE task. 82 * \retval 0 The specified TDE task is not completed. 83 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 84 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 85 * \retval ::HI_ERR_TDE_QUERY_TIMEOUT The specified task is not completed due to timeout. 86 * \retval ::HI_ERR_TDE_UNSUPPORTED_OPERATION The operation is not supported. 87 * \retval ::HI_ERR_TDE_INTERRUPT Blocked job was interrupted. 88 * \see \n 89 * N/A 90 */ 91 HI_S32 HI_TDE2_WaitForDone(TDE_HANDLE s32Handle); 92 93 /* 94 * \brief Waits for the completion of all TDE tasks. 95 * \attention \n 96 * As a block interface, this API is blocked until all TDE tasks are complete.\n 97 * \param N/A 98 * \retval 0 The specified TDE task is not completed. 99 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 100 * \retval ::HI_ERR_TDE_UNSUPPORTED_OPERATION The operation is not supported. 101 * \retval ::HI_ERR_TDE_INTERRUPT Blocked job was interrupted. 102 * N/A 103 */ 104 HI_S32 HI_TDE2_WaitAllDone(HI_VOID); 105 106 /* 107 * \brief Resets all statuses of the TDE. 108 * \attention \n 109 * This API is used to reset software and hardware if a timeout error occurs due to \n 110 * the inconsistency of the software and hardware for standby wakeup.\n 111 * \param N/A 112 * \retval 0 TDE reset successfully. 113 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 114 * \see \n 115 * N/A 116 */ 117 HI_S32 HI_TDE2_Reset(HI_VOID); 118 119 /* 120 * \brief Adds the fast copy operation to a TDE task. 121 * \attention \n 122 * HI_TDE2_QuickCopy adopts the direct memory access (DMA) transfer technology; therefore, \n 123 * HI_TDE2_QuickCopy is superior to HI_TDE2_Bitblit in transfer. \n 124 * Because the format conversion is not supported during fast copying, \n 125 * the formats of the source bitmap and the target bitmap must be the same.\n 126 * In addition, scaling is not supported during fast copying. If the operating area size of \n 127 * the source bitmap is different from that of the target bitmap, \n 128 * the copy and transfer operations are performed based on the minimum width and height.\n 129 * The specified operating area and the specified bitmap must have a public area; otherwise, \n 130 * an error is returned. This requirement is applicable to other operations.\n 131 * If the pixel format of a bitmap is greater than or equal to a byte, \n 132 * the base address and stride of the bitmap format must be aligned based on the pixel format. \n 133 * If the pixel format of a bitmap is smaller than a byte, the base address and \n 134 * stride of the bitmap must be aligned based on byte. This requirement is applicable to other operations.\n 135 * If the pixel format of a bitmap is smaller than a byte, \n 136 * the horizontal start point and width of the bitmap must be aligned based on pixel.\n 137 * The horizontal start point and width of the YCbCr422 bitmap must be even numbers. \n 138 * This requirement is applicable to other operations.\n 139 * \param[in] s32Handle Handle of a TDE task. 140 * \param[in] pstSrc Source bitmap. 141 * \param[in] pstSrcRect Operating area of the source bitmap. 142 * \param[in] pstDst Target bitmap. 143 * \param[in] pstDstRect Operating area of the target bitmap. 144 * \retval 0 success. 145 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 146 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 147 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 148 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 149 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 150 * \retval ::HI_FAILURE A system error or an unknown error occurs. 151 * \see \n 152 * N/A 153 */ 154 HI_S32 HI_TDE2_QuickCopy(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstSrc, const TDE2_RECT_S *pstSrcRect, 155 const TDE2_SURFACE_S *pstDst, const TDE2_RECT_S *pstDstRect); 156 157 /* 158 * \brief Rapidly fills in the target bitmap with a fixed value. 159 * \attention \n 160 * The data to be filled in must be specified based on the format of the target bitmap.\n 161 * \param[in] s32Handle Handle of a TDE task. 162 * \param[in] pstDst Target bitmap. 163 * \param[in] pstDstRect Operating area of the target bitmap. 164 * \param[in] u32FillData Data to be filled in. 165 * \retval 0 success. 166 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 167 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 168 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 169 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 170 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 171 * \retval ::HI_FAILURE A system error or an unknown error occurs. 172 * \see \n 173 * N/A 174 */ 175 HI_S32 HI_TDE2_QuickFill(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstDst, const TDE2_RECT_S *pstDstRect, 176 HI_U32 u32FillData); 177 178 /* 179 * \brief Scales the source bitmap based on a specified size of the target bitmap. 180 * The source bitmap and target bitmap can be the same. \n 181 * \attention \n 182 * The maximum minification is smaller than 256, there is no limit on magnification, \n 183 * but the max size of the bitmap is 4095*4095\n 184 * You can scale a bitmap that serves as both source bitmap and target bitmap. \n 185 * If the memories for storing the source bitmap and target bitmap overlap, the bitmaps cannot be scaled.\n 186 * \param[in] s32Handle Handle of a TDE task. 187 * \param[in] pstSrc Source bitmap. 188 * \param[in] pstSrcRect Operating area of the source bitmap. 189 * \param[in] pstDst Target bitmap. 190 * \param[in] pstDstRect Operating area of the target bitmap. 191 * \retval 0 success. 192 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 193 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 194 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 195 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 196 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 197 * \retval ::HI_ERR_TDE_NOT_ALIGNED The start address or stride of the bitmap is not aligned based on pixel. 198 * \retval ::HI_ERR_TDE_MINIFICATION The start address or stride of the bitmap is not aligned based on pixel. 199 * \retval ::HI_ERR_TDE_NOT_ALIGNED The start address of the color look-up table (CLUT) is not 4-byte aligned. 200 * \retval ::HI_ERR_TDE_UNSUPPORTED_OPERATION The operation is not supported. 201 * \retval ::HI_FAILURE A system error or an unknown error occurs. 202 * \see \n 203 * N/A 204 */ 205 HI_S32 HI_TDE2_QuickResize(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstSrc, const TDE2_RECT_S *pstSrcRect, 206 const TDE2_SURFACE_S *pstDst, const TDE2_RECT_S *pstDstRect); 207 208 /* 209 * \brief Adds the anti-flicker operation to a TDE task. 210 * \attention \n 211 * The anti-flicker operation supports vertical filtering only.\n 212 * The anti-flicker operation can be performed on the source bitmap \n 213 * and target bitmap that are stored in the same memory.\n 214 * If the sizes of the specified input area and output area are different, scaling is performed.\n 215 * \param[in] s32Handle Handle of a TDE task. 216 * \param[in] pstSrc Source bitmap. 217 * \param[in] pstSrcRect Operating area of the source bitmap. 218 * \param[in] pstDst Target bitmap. 219 * \param[in] pstDstRect Operating area of the target bitmap. 220 * \retval 0 success. 221 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 222 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 223 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 224 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 225 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 226 * \retval ::HI_ERR_TDE_NOT_ALIGNED The start address or stride of the bitmap is not aligned based on pixel. 227 * \retval ::HI_ERR_TDE_UNSUPPORTED_OPERATION The operation is not supported. 228 * \retval ::HI_ERR_TDE_MINIFICATION The minification is too large. 229 * \retval ::HI_FAILURE A system error or an unknown error occurs. 230 * \see \n 231 * N/A 232 */ 233 HI_S32 HI_TDE2_QuickDeflicker(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstSrc, const TDE2_RECT_S *pstSrcRect, 234 const TDE2_SURFACE_S *pstDst, const TDE2_RECT_S *pstDstRect); 235 236 /* 237 * \brief Adds the transfer operation (with additional functions available for the raster or 238 * macroblock bitmap) to a TDE task. 239 * \attention \n 240 * Before calling this API, you must call HI_TDE2_Open to start a TDE device and call HI_TDE2_BeginJob to \n 241 * obtain a valid task handle. If the sizes of the foreground bitmap and target bitmap are different, \n 242 * scaling is performed based on the preset scaling area. If no scaling area is set, \n 243 * the clip and transfer operations are performed based on the minimum value of the public area.\n 244 * The value of the global alpha, Alpha0, or Alpha1 ranges from 0 to 255.\n 245 * The background bitmap and the target bitmap can be the same.\n 246 * If only the single-source transfer operation with additional functions, \n 247 * you can set the structure information and the pointer of the \n 248 * operating area of the background or the background bitmap to null,\n 249 * but the pointer to the operation option type can't be null,and it doesn't support ColorKey and Blend.\n 250 * Scaling is not supported if the mirror function is enabled.\n 251 * If only the single-source transfer operation (for example, \n 252 * performing the ROP and reverse operations on the source bitmap only) is required, \n 253 * you can set the structure information and the pointer of the operating area of the background or \n 254 * the background bitmap to null. Scaling is not supported if the mirror function is enabled.\n 255 * The clip operation can be performed only when the clipping area overlaps the operating area; otherwise, 256 an error occurs.\n 257 * When the color extension (from CLUT to ARGB/AYCbCr) is performed for the first time, 258 * the CLUT Reload flag function must be enabled.\n 259 * During a simple transfer operation (the operation does not contain additional \n 260 * functions and the pixel format of source and target bitmaps are the same), you can set the pointer to \n 261 * the operation option type to null. Then fast transfer is implemented.\n 262 * The pixel format of the target bitmap cannot be the macroblock format.\n 263 * \param[in] s32Handle Handle of a TDE task. 264 * \param[in] pstBackGround Background bitmap. 265 * \param[in] pstBackGroundRect Operating area of the background bitmap. 266 * \param[in] pstForeGround Foreground bitmap. 267 * \param[in] pstForeGroundRect Operating area of the foreground bitmap. 268 * \param[in] pstDst Target bitmap. 269 * \param[in] pstDstRect Operating area of the target bitmap. 270 * \param[in] pstOpt Structure for setting operation parameters. 271 * \retval 0 success. 272 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 273 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 274 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 275 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 276 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 277 * \retval ::HI_ERR_TDE_NOT_ALIGNED The start address of the CLUT is not 4-byte aligned. 278 * \retval ::HI_ERR_TDE_MINIFICATION The minification is too large. 279 * \retval ::HI_ERR_TDE_UNSUPPORTED_OPERATION The bitmap does not support this operation. 280 * \retval ::HI_ERR_TDE_CLIP_AREA The operating area does not overlap the clipping area, 281 * and the displayed information is not updated. 282 * \retval ::HI_FAILURE A system error or an unknown error occurs. 283 * \see \n 284 * N/A 285 */ 286 HI_S32 HI_TDE2_Bitblit(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstBackGround, const TDE2_RECT_S *pstBackGroundRect, 287 const TDE2_SURFACE_S *pstForeGround, const TDE2_RECT_S *pstForeGroundRect, 288 const TDE2_SURFACE_S *pstDst, const TDE2_RECT_S *pstDstRect, const TDE2_OPT_S *pstOpt); 289 290 /* 291 * \brief Adds the fill and transfer operations (with additional functions available for the 292 raster bitmap) to a TDE task. \n 293 * After addition, the functions of drawing a point, drawing a line, filling in a color block on the surface, \n 294 * and filling in a memory can be implemented. 295 * \attention \n 296 * Before calling this API, you must call HI_TDE2_Open to start a TDE device and call HI_TDE2_BeginJob to 297 obtain a valid task handle.\n 298 * When the foreground bitmap is null, the functions of this API are the same as those of HI_TDE2_QuickFil.\n 299 * During solid drawing, the foreground bitmap supports the colorkey operation only.\n 300 * To draw a rectangle, a vertical line, or a horizontal line by calling HI_TDE2_SolidDraw, \n 301 * you need to set the width and height of the filled rectangle. For example, drawing a vertical \n 302 * line is to draw a rectangle with the width of one pixel. 303 * \param[in] s32Handle Handle of a TDE task. 304 * \param[in] pstForeGround Foreground bitmap. 305 * \param[in] pstForeGroundRect Operating area of the foreground bitmap. 306 * \param[in] pstDst Target bitmap. 307 * \param[in] pstDstRect Operating area of the target bitmap. 308 * \param[in] pstFillColor Structure of fill colors. 309 * \param[in] pstOpt Structure of operation attributes. 310 * \retval 0 success. 311 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 312 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 313 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 314 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 315 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 316 * \retval ::HI_ERR_TDE_NOT_ALIGNED The start address of the CLUT is not 4-byte aligned. 317 * \retval ::HI_ERR_TDE_MINIFICATION The minification is too large. 318 * \retval ::HI_ERR_TDE_UNSUPPORTED_OPERATION The bitmap does not support this operation. 319 * \retval ::HI_ERR_TDE_CLIP_AREA The operating area does not overlap the clipping area, 320 and the displayed information is not updated. 321 * \retval ::HI_FAILURE A system error or an unknown error occurs. 322 * \see \n 323 * N/A 324 */ 325 HI_S32 HI_TDE2_SolidDraw(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstForeGround, 326 const TDE2_RECT_S *pstForeGroundRect, const TDE2_SURFACE_S *pstDst, 327 const TDE2_RECT_S *pstDstRect, const TDE2_FILLCOLOR_S *pstFillColor, const TDE2_OPT_S *pstOpt); 328 329 /* 330 * \brief Adds the transfer operation (with additional functions available for the macroblock bitmap) \n 331 * to a TDE task. That is, the luminance macroblock data and the chrominance macroblock data are combined 332 into raster data. \n 333 * During the combination, the scaling, anti-flicker, and clip operations can be performed concurrently. 334 * \attention \n 335 * Before calling this API, you must call HI_TDE2_Open to start a TDE device and call HI_TDE2_BeginJob 336 to obtain a valid task handle.\n 337 * For the YCbCr422 macroblock, the horizontal coordination of the start point and the width of the 338 operating area must be an even number.\n 339 * The pixel format of the target bitmap cannot be the macroblock format.\n 340 * \param[in] s32Handle Handle of a TDE task. 341 * \param[in] pstMB Surface of a macroblock. 342 * \param[in] pstMbRect Operating area of a macroblock. 343 * \param[in] pstDst Target bitmap. 344 * \param[in] pstDstRect Operating area of the target bitmap. 345 * \param[in] pstMbOpt Operation attributes of a macroblock. 346 * \retval 0 success. 347 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 348 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 349 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 350 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 351 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 352 * \retval ::HI_ERR_TDE_MINIFICATION The minification is too large because its maximum value is 255. 353 * \retval ::HI_ERR_TDE_UNSUPPORTED_OPERATION The bitmap does not support this operation. 354 * \retval ::HI_ERR_TDE_CLIP_AREA The operating area does not overlap the clipping area, 355 * and the displayed information is not updated. 356 * \retval ::HI_FAILURE A system error or an unknown error occurs. 357 * \see \n 358 * N/A 359 */ 360 HI_S32 HI_TDE2_MbBlit(TDE_HANDLE s32Handle, const TDE2_MB_S *pstMB, const TDE2_RECT_S *pstMbRect, 361 const TDE2_SURFACE_S *pstDst, const TDE2_RECT_S *pstDstRect, const TDE2_MBOPT_S *pstMbOpt); 362 363 /* 364 * \brief Adds the mask raster of operation (ROP) (available for the raster bitmap) to a TDE task. That is, \n 365 * the ROP operation is performed on the foreground bitmap and the background bitmap based on the mask bitmap. 366 * \attention \n 367 * Before calling this API, you must call HI_TDE2_Open to start a TDE device and call HI_TDE2_BeginJob 368 to obtain a valid task handle.\n 369 * The sizes of the operating areas of the mask bitmap, foreground bitmap, and background bitmap must be the same.\n 370 * The mask bitmap must be in A1 format.\n 371 * The target bitmap and foreground bitmap must be in the same color space.\n 372 * \param[in] s32Handle Handle of a TDE task. 373 * \param[in] pstBackGround Background bitmap. 374 * \param[in] pstBackGroundRect Operating area of the background bitmap. 375 * \param[in] pstForeGround Foreground bitmap. 376 * \param[in] pstForeGroundRect Operating area of the foreground bitmap. 377 * \param[in] pstMask Mask bitmap. 378 * \param[in] pstMaskRect Operating area of the mask bitmap. 379 * \param[in] pstDst Target bitmap. 380 * \param[in] pstDstRect Operating area of the target bitmap. 381 * \param[in] enRopCode_Color ROP code of a color component. 382 * \param[in] enRopCode_Alpha ROP code of the alpha component. 383 * \retval 0 success. 384 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 385 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 386 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 387 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 388 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 389 * \retval ::HI_FAILURE A system error or an unknown error occurs. 390 * \see \n 391 * N/A 392 */ 393 HI_S32 HI_TDE2_BitmapMaskRop(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstBackGround, 394 const TDE2_RECT_S *pstBackGroundRect, const TDE2_SURFACE_S *pstForeGround, 395 const TDE2_RECT_S *pstForeGroundRect, const TDE2_SURFACE_S *pstMask, 396 const TDE2_RECT_S *pstMaskRect, const TDE2_SURFACE_S *pstDst, 397 const TDE2_RECT_S *pstDstRect, TDE2_ROP_CODE_E enRopCode_Color, 398 TDE2_ROP_CODE_E enRopCode_Alpha); 399 400 /* 401 * \brief Adds the mask blend operation (available for the raster bitmap) to a TDE task. That is, \n 402 * the foreground bitmap and the background bitmap are blending with the mask bitmap based on the mask bitmap. 403 * \attention \n 404 * Before calling this API, you must call HI_TDE2_Open to start a TDE device and call HI_TDE2_BeginJob to 405 obtain a valid task handle.\n 406 * The target bitmap and background bitmap must be in the same color space.\n 407 * If the foreground bitmap contains the premultiplied data, the premultiplied mode must \n 408 * be selected during alpha blending; otherwise, the non-premultiplied mode is selected. 409 * The parameter enBlendMode cannot be set to TDE2_ALUCMD_ROP.\n 410 * \param[in] s32Handle Handle of a TDE task. 411 * \param[in] pstBackGround Background bitmap. 412 * \param[in] pstBackGroundRect Operating area of the background bitmap. 413 * \param[in] pstForeGround Foreground bitmap. 414 * \param[in] pstForeGroundRect Operating area of the foreground bitmap. 415 * \param[in] pstMask Mask bitmap. 416 * \param[in] pstMaskRect Operating area of the mask bitmap. 417 * \param[in] pstDst Target bitmap. 418 * \param[in] pstDstRect Operating area of the target bitmap. 419 * \param[in] u8Alpha Global alpha value during alpha blending. 420 * \param[in] enBlendMode Alpha blending mode. 421 * \retval 0 success. 422 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 423 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 424 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 425 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 426 * \retval ::HI_ERR_TDE_NO_MEM Adding an operation fails due to insufficient memory. 427 * \retval ::HI_FAILURE A system error or an unknown error occurs. 428 * \see \n 429 * N/A 430 */ 431 HI_S32 HI_TDE2_BitmapMaskBlend(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstBackGround, 432 const TDE2_RECT_S *pstBackGroundRect, const TDE2_SURFACE_S *pstForeGround, 433 const TDE2_RECT_S *pstForeGroundRect, const TDE2_SURFACE_S *pstMask, 434 const TDE2_RECT_S *pstMaskRect, const TDE2_SURFACE_S *pstDst, 435 const TDE2_RECT_S *pstDstRect, HI_U8 u8Alpha, TDE2_ALUCMD_E enBlendMode); 436 437 /* 438 * \brief Adds the rotation operation to a TDE task. 439 * \attention \n 440 * The pixel formats of the source bitmap and target bitmap must be the same, and the format 441 cannot be YUV, CLUT1, or CLUT4.\n 442 * The parameters s32DstPointX and s32DstPointY are set to 0 by default. \n 443 * Because the two parameters are not used at present, they can be set to any values.\n 444 * \param[in] s32Handle Handle of a TDE task. 445 * \param[in] pstSrc Source bitmap. 446 * \param[in] pstSrcRect Operating area of the source bitmap. 447 * \param[in] pstDst Target bitmap. 448 * \param[in] s32DstPointX Horizontal coordinate of the start point of the operating area in the target bitmap. 449 * \param[in] s32DstPointY Vertical coordinate of the start point of the operating area in the target bitmap. 450 * \param[in] enRotateAngle Rotate angle. 451 * \retval 0 success. 452 * \retval ::HI_ERR_TDE_DEV_NOT_OPEN Calling this API fails because no TDE device is started. 453 * \retval ::HI_ERR_TDE_INVALID_HANDLE The handle of a TDE task is invalid. 454 * \retval ::HI_ERR_TDE_NULL_PTR The parameter contains a null pointer. 455 * \retval ::HI_ERR_TDE_UNSUPPORTED_OPERATION The operation is not supported. 456 * \retval ::HI_ERR_TDE_INVALID_PARA The parameter is invalid. 457 * \see \n 458 * N/A 459 */ 460 HI_S32 HI_TDE2_Rotate(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstSrc, const TDE2_RECT_S *pstSrcRect, 461 const TDE2_SURFACE_S *pstDst, const TDE2_RECT_S *pstDstRect, TDE_ROTATE_ANGLE_E enRotateAngle); 462 463 /* 464 * \brief Sets the anti-flicker level. 465 * \attention \n 466 * N/A 467 * \param[in] enDeflickerLevel Anti-flicker level. 468 * \retval 0 success. 469 * \retval :: 470 * \see none 471 */ 472 HI_S32 HI_TDE2_SetDeflickerLevel(TDE_DEFLICKER_LEVEL_E enDeflickerLevel); 473 474 /* 475 * \brief Obtains the anti-flicker level. 476 * \attention \n 477 * N/A 478 * \param[in] pDeflickerLevel Anti-flicker level. 479 * \retval 0 success. 480 * \retval :: 481 * \see \n 482 * N/A 483 */ 484 HI_S32 HI_TDE2_GetDeflickerLevel(TDE_DEFLICKER_LEVEL_E *pDeflickerLevel); 485 486 /* 487 * \brief Sets the alpha judgment threshold. 488 * \attention \n 489 * N/A 490 * \param[in] u8ThresholdValue Judgment threshold. 491 * \retval 0 success. 492 * \retval :: 493 * \see \n 494 * N/A 495 */ 496 HI_S32 HI_TDE2_SetAlphaThresholdValue(HI_U8 u8ThresholdValue); 497 498 /* 499 * \brief Obtains the alpha judgment threshold. 500 * \attention \n 501 * N/A 502 * \param[in] pu8ThresholdValue Judgment threshold. 503 * \retval 0 success. 504 * \retval :: 505 * \see \n 506 * N/A 507 */ 508 HI_S32 HI_TDE2_GetAlphaThresholdValue(HI_U8 *pu8ThresholdValue); 509 510 /* 511 * \brief Enables or disables the alpha judgment. 512 * \attention N/A 513 * \param[in] bEnAlphaThreshold Whether to enable the alpha judgment. 514 * \retval 0 success. 515 * \retval :: 516 * \see \n 517 * N/A 518 */ 519 HI_S32 HI_TDE2_SetAlphaThresholdState(HI_BOOL bEnAlphaThreshold); 520 521 /* 522 * \brief Obtains the enable status of the alpha judgment. 523 * \attention N/A 524 * \param[in] p_bEnAlphaThreshold Whether to enable the alpha judgment. 525 * \retval 0 success. 526 * \retval :: 527 * \see \n 528 * N/A 529 */ 530 HI_S32 HI_TDE2_GetAlphaThresholdState(HI_BOOL *p_bEnAlphaThreshold); 531 532 /* 533 * \brief Fills in the pattern. 534 * \attention N/A 535 * \param[in] s32Handle Handle of a TDE task. 536 * \param[in] pstBackGround Background bitmap. 537 * \param[in] pstBackGroundRect Operating rectangle of the background bitmap. 538 * \param[in] pstForeGround Foreground bitmap. 539 * \param[in] pstForeGroundRect Operating rectangle of the foreground bitmap. 540 * \param[in] pstDst Target bitmap. 541 * \param[in] pstDstRect Operating rectangle of the target bitmap. 542 * \param[in] pstOpt Options for pattern filling. 543 * \retval 0 success. 544 * \retval :: 545 * \see \n 546 * N/A 547 */ 548 HI_S32 HI_TDE2_PatternFill(TDE_HANDLE s32Handle, const TDE2_SURFACE_S *pstBackGround, 549 const TDE2_RECT_S *pstBackGroundRect, const TDE2_SURFACE_S *pstForeGround, 550 const TDE2_RECT_S *pstForeGroundRect, const TDE2_SURFACE_S *pstDst, 551 const TDE2_RECT_S *pstDstRect, const TDE2_PATTERN_FILL_OPT_S *pstOpt); 552 553 /* 554 * \brief Enables or disables the regional anti-flicker function. 555 * \attention N/A 556 * \param[in] bRegionDeflicker Enable/disable flag. 557 * \retval 0 success. 558 * \retval :: 559 * \see \n 560 * N/A 561 */ 562 HI_S32 HI_TDE2_EnableRegionDeflicker(HI_BOOL bRegionDeflicker); 563 564 /* 565 * \brief: multi blend surface by surface list 566 * \param[in]: composed surface list 567 * \retval: 0 success 568 */ 569 HI_S32 HI_TDE2_MultiBlending(TDE_HANDLE s32Handle, const TDE_SURFACE_LIST_S *pstSurfaceList); 570 571 /** @} */ /** <!-- ==== API declaration end ==== */ 572 #ifdef __cplusplus 573 #if __cplusplus 574 } 575 #endif /* __cplusplus */ 576 #endif /* __cplusplus */ 577 578 #endif /* _HI_API_TDE2_H_ */ 579