FreeRDP
Loading...
Searching...
No Matches
rfx.h
1
22#ifndef FREERDP_CODEC_REMOTEFX_H
23#define FREERDP_CODEC_REMOTEFX_H
24
25#include <freerdp/api.h>
26#include <freerdp/types.h>
27#include <freerdp/constants.h>
28#include <freerdp/codec/region.h>
29
30#include <winpr/stream.h>
31
32#ifdef __cplusplus
33extern "C"
34{
35#endif
36
37 typedef enum
38 {
39 RLGR1,
40 RLGR3
41 } RLGR_MODE;
42
43 typedef struct
44 {
45 UINT16 x;
46 UINT16 y;
47 UINT16 width;
48 UINT16 height;
49 } RFX_RECT;
50
51 typedef struct
52 {
53 UINT16 x;
54 UINT16 y;
55 UINT32 width;
56 UINT32 height;
57 BYTE* data;
58 UINT32 scanline;
59 BOOL allocated;
60 BYTE quantIdxY;
61 BYTE quantIdxCb;
62 BYTE quantIdxCr;
63 UINT16 xIdx;
64 UINT16 yIdx;
65 UINT16 YLen;
66 UINT16 CbLen;
67 UINT16 CrLen;
68 BYTE* YData;
69 BYTE* CbData;
70 BYTE* CrData;
71 BYTE* YCbCrData;
72 } RFX_TILE;
73
74 typedef struct S_RFX_MESSAGE_LIST RFX_MESSAGE_LIST;
75 typedef struct S_RFX_MESSAGE RFX_MESSAGE;
76 typedef struct S_RFX_CONTEXT RFX_CONTEXT;
77
78 WINPR_ATTR_NODISCARD
79 FREERDP_API BOOL rfx_process_message(RFX_CONTEXT* WINPR_RESTRICT context,
80 const BYTE* WINPR_RESTRICT data, UINT32 length,
81 UINT32 left, UINT32 top, BYTE* WINPR_RESTRICT dst,
82 UINT32 dstFormat, UINT32 dstStride, UINT32 dstHeight,
83 REGION16* WINPR_RESTRICT invalidRegion);
84
85 WINPR_ATTR_NODISCARD
86 FREERDP_API UINT32 rfx_message_get_frame_idx(const RFX_MESSAGE* WINPR_RESTRICT message);
87
88 WINPR_ATTR_NODISCARD
89 FREERDP_API const UINT32* rfx_message_get_quants(const RFX_MESSAGE* WINPR_RESTRICT message,
90 UINT16* WINPR_RESTRICT numQuantVals);
91
92 WINPR_ATTR_NODISCARD
93 FREERDP_API const RFX_TILE** rfx_message_get_tiles(const RFX_MESSAGE* WINPR_RESTRICT message,
94 UINT16* WINPR_RESTRICT numTiles);
95
96 WINPR_ATTR_NODISCARD
97 FREERDP_API UINT16 rfx_message_get_tile_count(const RFX_MESSAGE* WINPR_RESTRICT message);
98
99 WINPR_ATTR_NODISCARD
100 FREERDP_API const RFX_RECT* rfx_message_get_rects(const RFX_MESSAGE* WINPR_RESTRICT message,
101 UINT16* WINPR_RESTRICT numRects);
102
103 WINPR_ATTR_NODISCARD
104 FREERDP_API UINT16 rfx_message_get_rect_count(const RFX_MESSAGE* WINPR_RESTRICT message);
105
106 FREERDP_API void rfx_message_free(RFX_CONTEXT* WINPR_RESTRICT context,
107 RFX_MESSAGE* WINPR_RESTRICT message);
108
109 WINPR_ATTR_NODISCARD
110 FREERDP_API BOOL rfx_compose_message(RFX_CONTEXT* WINPR_RESTRICT context,
111 wStream* WINPR_RESTRICT s,
112 const RFX_RECT* WINPR_RESTRICT rects, size_t numRects,
113 const BYTE* WINPR_RESTRICT data, UINT32 width,
114 UINT32 height, UINT32 scanline);
115
116 WINPR_ATTR_MALLOC(rfx_message_free, 2)
117 WINPR_ATTR_NODISCARD
118 FREERDP_API RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* WINPR_RESTRICT context,
119 const RFX_RECT* WINPR_RESTRICT rects,
120 size_t numRects, const BYTE* WINPR_RESTRICT data,
121 UINT32 width, UINT32 height, size_t scanline);
122
123 FREERDP_API void rfx_message_list_free(RFX_MESSAGE_LIST* messages);
124
125 WINPR_ATTR_MALLOC(rfx_message_list_free, 1)
126 WINPR_ATTR_NODISCARD
127 FREERDP_API RFX_MESSAGE_LIST*
128 rfx_encode_messages(RFX_CONTEXT* WINPR_RESTRICT context, const RFX_RECT* WINPR_RESTRICT rects,
129 size_t numRects, const BYTE* WINPR_RESTRICT data, UINT32 width,
130 UINT32 height, UINT32 scanline, size_t* WINPR_RESTRICT numMessages,
131 size_t maxDataSize);
132
133 WINPR_ATTR_NODISCARD
134 FREERDP_API const RFX_MESSAGE*
135 rfx_message_list_get(const RFX_MESSAGE_LIST* WINPR_RESTRICT messages, size_t idx);
136
137 WINPR_ATTR_NODISCARD
138 FREERDP_API BOOL rfx_write_message(RFX_CONTEXT* WINPR_RESTRICT context,
139 wStream* WINPR_RESTRICT s,
140 const RFX_MESSAGE* WINPR_RESTRICT message);
141
142 FREERDP_API void rfx_context_free(RFX_CONTEXT* context);
143
144 WINPR_ATTR_MALLOC(rfx_context_free, 1)
145 WINPR_ATTR_NODISCARD
146 FREERDP_API RFX_CONTEXT* rfx_context_new_ex(BOOL encoder, UINT32 ThreadingFlags);
147
148 WINPR_ATTR_MALLOC(rfx_context_free, 1)
149 WINPR_ATTR_NODISCARD
150 FREERDP_API RFX_CONTEXT* rfx_context_new(BOOL encoder);
151
152 WINPR_ATTR_NODISCARD
153 FREERDP_API BOOL rfx_context_reset(RFX_CONTEXT* WINPR_RESTRICT context, UINT32 width,
154 UINT32 height);
155
156 WINPR_ATTR_NODISCARD
157 FREERDP_API BOOL rfx_context_set_mode(RFX_CONTEXT* WINPR_RESTRICT context, RLGR_MODE mode);
158
166 WINPR_ATTR_NODISCARD
167 FREERDP_API RLGR_MODE rfx_context_get_mode(RFX_CONTEXT* WINPR_RESTRICT context);
168
169 FREERDP_API void rfx_context_set_pixel_format(RFX_CONTEXT* WINPR_RESTRICT context,
170 UINT32 pixel_format);
171
179 WINPR_ATTR_NODISCARD
180 FREERDP_API UINT32 rfx_context_get_pixel_format(RFX_CONTEXT* WINPR_RESTRICT context);
181
182 FREERDP_API void rfx_context_set_palette(RFX_CONTEXT* WINPR_RESTRICT context,
183 const BYTE* WINPR_RESTRICT palette);
184
192 WINPR_ATTR_NODISCARD
193 FREERDP_API const BYTE* rfx_context_get_palette(RFX_CONTEXT* WINPR_RESTRICT context);
194
195 WINPR_ATTR_NODISCARD
196 FREERDP_API UINT32 rfx_context_get_frame_idx(const RFX_CONTEXT* WINPR_RESTRICT context);
197
207 WINPR_ATTR_NODISCARD
208 FREERDP_API BOOL rfx_write_message_progressive_simple(RFX_CONTEXT* WINPR_RESTRICT rfx,
209 wStream* WINPR_RESTRICT s,
210 const RFX_MESSAGE* WINPR_RESTRICT msg);
211
212#ifdef __cplusplus
213}
214#endif
215
216#endif /* FREERDP_CODEC_REMOTEFX_H */
Definition rfx.h:44
Definition rfx.h:52