FreeRDP
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
33 extern "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  FREERDP_API BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length,
79  UINT32 left, UINT32 top, BYTE* dst, UINT32 dstFormat,
80  UINT32 dstStride, UINT32 dstHeight,
81  REGION16* invalidRegion);
82 
83  FREERDP_API UINT32 rfx_message_get_frame_idx(const RFX_MESSAGE* message);
84  FREERDP_API const UINT32* rfx_message_get_quants(const RFX_MESSAGE* message,
85  UINT16* numQuantVals);
86 
87  FREERDP_API const RFX_TILE** rfx_message_get_tiles(const RFX_MESSAGE* message,
88  UINT16* numTiles);
89  FREERDP_API UINT16 rfx_message_get_tile_count(const RFX_MESSAGE* message);
90 
91  FREERDP_API const RFX_RECT* rfx_message_get_rects(const RFX_MESSAGE* message, UINT16* numRects);
92  FREERDP_API UINT16 rfx_message_get_rect_count(const RFX_MESSAGE* message);
93 
94  FREERDP_API void rfx_message_free(RFX_CONTEXT* context, RFX_MESSAGE* message);
95 
96  FREERDP_API BOOL rfx_compose_message(RFX_CONTEXT* context, wStream* s, const RFX_RECT* rects,
97  size_t num_rects, const BYTE* image_data, UINT32 width,
98  UINT32 height, UINT32 rowstride);
99 
100  FREERDP_API RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects,
101  size_t numRects, const BYTE* data, UINT32 width,
102  UINT32 height, size_t scanline);
103 
104  FREERDP_API RFX_MESSAGE_LIST* rfx_encode_messages(RFX_CONTEXT* context, const RFX_RECT* rects,
105  size_t numRects, const BYTE* data,
106  UINT32 width, UINT32 height, UINT32 scanline,
107  size_t* numMessages, size_t maxDataSize);
108  FREERDP_API void rfx_message_list_free(RFX_MESSAGE_LIST* messages);
109 
110  FREERDP_API const RFX_MESSAGE* rfx_message_list_get(const RFX_MESSAGE_LIST* messages,
111  size_t idx);
112 
113  FREERDP_API BOOL rfx_write_message(RFX_CONTEXT* context, wStream* s,
114  const RFX_MESSAGE* message);
115 
116  FREERDP_API void rfx_context_free(RFX_CONTEXT* context);
117 
118  WINPR_ATTR_MALLOC(rfx_context_free, 1)
119  FREERDP_API RFX_CONTEXT* rfx_context_new_ex(BOOL encoder, UINT32 ThreadingFlags);
120 
121  WINPR_ATTR_MALLOC(rfx_context_free, 1)
122  FREERDP_API RFX_CONTEXT* rfx_context_new(BOOL encoder);
123 
124  FREERDP_API BOOL rfx_context_reset(RFX_CONTEXT* WINPR_RESTRICT context, UINT32 width,
125  UINT32 height);
126 
127  FREERDP_API BOOL rfx_context_set_mode(RFX_CONTEXT* context, RLGR_MODE mode);
128 
136  FREERDP_API RLGR_MODE rfx_context_get_mode(RFX_CONTEXT* WINPR_RESTRICT context);
137 
138  FREERDP_API void rfx_context_set_pixel_format(RFX_CONTEXT* WINPR_RESTRICT context,
139  UINT32 pixel_format);
140 
148  FREERDP_API UINT32 rfx_context_get_pixel_format(RFX_CONTEXT* WINPR_RESTRICT context);
149 
150  FREERDP_API void rfx_context_set_palette(RFX_CONTEXT* WINPR_RESTRICT context,
151  const BYTE* WINPR_RESTRICT palette);
152 
160  FREERDP_API const BYTE* rfx_context_get_palette(RFX_CONTEXT* WINPR_RESTRICT context);
161 
162  FREERDP_API UINT32 rfx_context_get_frame_idx(const RFX_CONTEXT* WINPR_RESTRICT context);
163 
173  FREERDP_API BOOL rfx_write_message_progressive_simple(RFX_CONTEXT* rfx, wStream* s,
174  const RFX_MESSAGE* msg);
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif /* FREERDP_CODEC_REMOTEFX_H */
Definition: rfx.h:44
Definition: rfx.h:52