hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
 * Copyright 2020 Rockchip Electronics Co. LTD
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
 
#ifndef SRC_RT_MPI_INCLUDE_RK_COMM_TDE_H_
#define SRC_RT_MPI_INCLUDE_RK_COMM_TDE_H_
 
#include "rk_type.h"
#include "rk_common.h"
#include "rk_comm_mb.h"
#include "rk_errno.h"
#include "rk_comm_video.h"
 
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */
 
// error code
enum {
    RK_ERR_NOT_ALIGNED = RK_ERR_BUTT - 1,  /* <  aligned error for position, stride, width */
    RK_ERR_MINIFICATION,                   /* <  invalid minification */
    RK_ERR_CLIP_AREA,                      /* <  clip area and operation area have no intersection */
    RK_ERR_JOB_TIMEOUT,                    /* <  blocked job wait timeout */
    RK_ERR_UNSUPPORTED_OPERATION,          /* <  unsupported operation */
    RK_ERR_QUERY_TIMEOUT,                  /* <  query time out */
    RK_ERR_INTERRUPT                       /* blocked job was interrupted */
};
 
#define RK_ERR_TDE_DEV_NOT_OPEN           RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_UNEXIST)
#define RK_ERR_TDE_DEV_OPEN_FAILED        RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_BUSY)
#define RK_ERR_TDE_NULL_PTR               RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_NULL_PTR)
#define RK_ERR_TDE_NO_MEM                 RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_NOMEM)
#define RK_ERR_TDE_INVALID_HANDLE         RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_INVALID_DEVID)
#define RK_ERR_TDE_INVALID_PARA           RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_ILLEGAL_PARAM)
#define RK_ERR_TDE_NOT_ALIGNED            RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_NOT_ALIGNED)
#define RK_ERR_TDE_MINIFICATION           RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_MINIFICATION)
#define RK_ERR_TDE_CLIP_AREA              RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_CLIP_AREA)
#define RK_ERR_TDE_JOB_TIMEOUT            RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_JOB_TIMEOUT)
#define RK_ERR_TDE_UNSUPPORTED_OPERATION  RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_UNSUPPORTED_OPERATION)
#define RK_ERR_TDE_QUERY_TIMEOUT          RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_QUERY_TIMEOUT)
#define RK_ERR_TDE_INTERRUPT              RK_DEF_ERR(RK_ID_TDE, RK_ERR_LEVEL_ERROR, RK_ERR_INTERRUPT)
 
/* Definition of the TDE handle */
typedef RK_S32 TDE_HANDLE;
 
typedef enum rkTDE_ALUCMD_E {
    TDE_OSD_COVER = 0x100,      /* not blend */
    TDE_OSD_DST_ALPHA = 0x105,  /* blend:src data alpha premultipy */
    TDE_OSD_ALL_ALPHA = 0x405   /* blend:src data not alpha premultipy */
} TDE_ALUCMD_E;
 
/* Structure of the bitmap information set by customers */
typedef struct rkTDE_SURFACE_S {
    MB_BLK pMbBlk;/* <Header address of a bitmap or the Y component */
 
    PIXEL_FORMAT_E enColorFmt; /* <Color format */
 
    RK_U32 u32Height; /* <Bitmap height */
 
    RK_U32 u32Width; /* <Bitmap width */
 
    COMPRESS_MODE_E enComprocessMode; /* compress type */
} TDE_SURFACE_S;
 
/* Definition of the TDE rectangle */
typedef struct rkTDE_RECT_S {
    RK_S32 s32Xpos;   /* <Horizontal coordinate */
    RK_S32 s32Ypos;   /* <Vertical coordinate */
    RK_U32 u32Width;  /* <Width */
    RK_U32 u32Height; /* <Height */
} TDE_RECT_S;
 
/* Definition of colorkey modes */
typedef enum rkTDE_COLORKEY_MODE_E {
    TDE_COLORKEY_MODE_NONE = 0,   /* <No colorkey */
     /*
      * <When performing the colorkey operation on the foreground bitmap,
      * you need to perform this operation before the CLUT for color extension and perform this operation
      * after the CLUT for color correction.
      */
    TDE_COLORKEY_MODE_FOREGROUND,
    TDE_COLORKEY_MODE_BACKGROUND, /* <Perform the colorkey operation on the background bitmap */
    TDE_COLORKEY_MODE_BUTT
} TDE_COLORKEY_MODE_E;
 
/* Definition of blit operation options */
typedef struct rkTDE_OPT_S {
    TDE_COLORKEY_MODE_E enColorKeyMode;  /* <Colorkey mode */
    RK_U32              unColorKeyValue; /* <Colorkey value */
    MIRROR_E            enMirror;        /* <Mirror type */
    TDE_RECT_S          stClipRect;      /* <Definition of the clipping area */
    RK_U32              u32GlobalAlpha;   /* <Global alpha value */
} TDE_OPT_S;
 
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
 
#endif /* SRC_RT_MPI_INCLUDE_RK_COMM_TDE_H_ */