FreeRDP
Loading...
Searching...
No Matches
nsc.h
1
23#ifndef FREERDP_CODEC_NSCODEC_H
24#define FREERDP_CODEC_NSCODEC_H
25
26#include <freerdp/api.h>
27#include <freerdp/types.h>
28#include <freerdp/constants.h>
29
30#include <winpr/stream.h>
31
32#ifdef __cplusplus
33extern "C"
34{
35#endif
36
39 typedef enum
40 {
41 NSC_COLOR_LOSS_LEVEL,
42 NSC_ALLOW_SUBSAMPLING,
43 NSC_DYNAMIC_COLOR_FIDELITY,
44 NSC_COLOR_FORMAT
45 } NSC_PARAMETER;
46
47 typedef struct S_NSC_CONTEXT NSC_CONTEXT;
48
49#if defined(WITH_FREERDP_DEPRECATED)
50 WINPR_DEPRECATED_VAR("Use nsc_context_set_parameters(NSC_COLOR_FORMAT)",
51 WINPR_ATTR_NODISCARD FREERDP_API BOOL nsc_context_set_pixel_format(
52 NSC_CONTEXT* context, UINT32 pixel_format));
53#endif
54
63 WINPR_ATTR_NODISCARD
64 FREERDP_API BOOL nsc_context_set_parameters(NSC_CONTEXT* WINPR_RESTRICT context,
65 NSC_PARAMETER what, UINT32 value);
66
88 WINPR_ATTR_NODISCARD
89 FREERDP_API BOOL nsc_process_message(NSC_CONTEXT* WINPR_RESTRICT context, UINT16 bpp,
90 UINT32 width, UINT32 height, const BYTE* data,
91 UINT32 length, BYTE* WINPR_RESTRICT pDstData,
92 UINT32 DstFormat, UINT32 nDstStride, UINT32 nXDst,
93 UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 flip);
94
107 WINPR_ATTR_NODISCARD
108 FREERDP_API BOOL nsc_compose_message(NSC_CONTEXT* WINPR_RESTRICT context,
109 wStream* WINPR_RESTRICT s,
110 const BYTE* WINPR_RESTRICT bmpdata, UINT32 width,
111 UINT32 height, UINT32 scanline);
112
113#if !defined(WITHOUT_FREERDP_3x_DEPRECATED)
114
115 WINPR_DEPRECATED_VAR(
116 "[since 3.23.0] deprecated, insecure! missing length checks. use nsc_process_message",
117 WINPR_ATTR_NODISCARD FREERDP_API BOOL
118 nsc_decompose_message(NSC_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s,
119 BYTE* WINPR_RESTRICT bmpdata, UINT32 x, UINT32 y, UINT32 width,
120 UINT32 height, UINT32 rowstride, UINT32 format, UINT32 flip));
121#endif
122
131 WINPR_ATTR_NODISCARD
132 FREERDP_API BOOL nsc_context_reset(NSC_CONTEXT* WINPR_RESTRICT context, UINT32 width,
133 UINT32 height);
134
135 FREERDP_API void nsc_context_free(NSC_CONTEXT* context);
136
137 WINPR_ATTR_MALLOC(nsc_context_free, 1)
138 WINPR_ATTR_NODISCARD
139 FREERDP_API NSC_CONTEXT* nsc_context_new(void);
140
141#ifdef __cplusplus
142}
143#endif
144
145#endif /* FREERDP_CODEC_NSCODEC_H */