FreeRDP
nsc_types.h
1 
21 #ifndef FREERDP_LIB_CODEC_NSC_TYPES_H
22 #define FREERDP_LIB_CODEC_NSC_TYPES_H
23 
24 #include <freerdp/config.h>
25 
26 #include <winpr/crt.h>
27 #include <winpr/wlog.h>
28 #include <winpr/collections.h>
29 
30 #include <freerdp/utils/profiler.h>
31 #include <freerdp/codec/nsc.h>
32 
33 #define ROUND_UP_TO(_b, _n) (_b + ((~(_b & (_n - 1)) + 0x1) & (_n - 1)))
34 #define MINMAX(_v, _l, _h) ((_v) < (_l) ? (_l) : ((_v) > (_h) ? (_h) : (_v)))
35 
36 typedef struct
37 {
38  wLog* log;
39 
40  BYTE* PlaneBuffers[5]; /* Decompressed Plane Buffers in the respective order */
41  UINT32 PlaneBuffersLength; /* Lengths of each plane buffer */
42 
43  /* profilers */
44  PROFILER_DEFINE(prof_nsc_rle_decompress_data)
45  PROFILER_DEFINE(prof_nsc_decode)
46  PROFILER_DEFINE(prof_nsc_rle_compress_data)
47  PROFILER_DEFINE(prof_nsc_encode)
49 
51 {
52  UINT32 OrgByteCount[4];
53  UINT32 format;
54  UINT16 width;
55  UINT16 height;
56  BYTE* BitmapData;
57  size_t BitmapDataLength;
58 
59  BYTE* Planes;
60  size_t PlanesSize;
61  UINT32 PlaneByteCount[4];
62  UINT32 ColorLossLevel;
63  UINT32 ChromaSubsamplingLevel;
64  BOOL DynamicColorFidelity;
65 
66  /* color palette allocated by the application */
67  const BYTE* palette;
68 
69  BOOL (*decode)(NSC_CONTEXT* WINPR_RESTRICT context);
70  BOOL(*encode)
71  (NSC_CONTEXT* WINPR_RESTRICT context, const BYTE* WINPR_RESTRICT BitmapData, UINT32 rowstride);
72 
73  NSC_CONTEXT_PRIV* priv;
74 };
75 
76 #endif /* FREERDP_LIB_CODEC_NSC_TYPES_H */