~freenx-team/nx-x11/nxcomp-upstream

« back to all changes in this revision

Viewing changes to NXpack.h

  • Committer: Marcelo Boveto Shima
  • Date: 2009-03-28 22:24:56 UTC
  • Revision ID: mshima@ufserv-20090328222456-rdtaq3oedfyq890c
Import nxcomp 3.3.0-3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************/
 
2
/*                                                                        */
 
3
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/.         */
 
4
/*                                                                        */
 
5
/* NXCOMP, NX protocol compression and NX extensions to this software     */
 
6
/* are copyright of NoMachine. Redistribution and use of the present      */
 
7
/* software is allowed according to terms specified in the file LICENSE   */
 
8
/* which comes in the source distribution.                                */
 
9
/*                                                                        */
 
10
/* Check http://www.nomachine.com/licensing.html for applicability.       */
 
11
/*                                                                        */
 
12
/* NX and NoMachine are trademarks of NoMachine S.r.l.                    */
 
13
/*                                                                        */
 
14
/* All rights reserved.                                                   */
 
15
/*                                                                        */
 
16
/**************************************************************************/
 
17
 
 
18
#ifndef NXpack_H
 
19
#define NXpack_H
 
20
 
 
21
#ifdef __cplusplus
 
22
extern "C" {
 
23
#endif
 
24
 
 
25
#define MASK_METHOD_LIMIT                       10
 
26
 
 
27
#define NO_MASK                                 0
 
28
 
 
29
#define MASK_8_COLORS                           1
 
30
#define MASK_64_COLORS                          2
 
31
#define MASK_256_COLORS                         3
 
32
#define MASK_512_COLORS                         4
 
33
#define MASK_4K_COLORS                          5
 
34
#define MASK_32K_COLORS                         6
 
35
#define MASK_64K_COLORS                         7
 
36
#define MASK_256K_COLORS                        8
 
37
#define MASK_2M_COLORS                          9
 
38
#define MASK_16M_COLORS                         10
 
39
 
 
40
#define PACK_METHOD_LIMIT                       128
 
41
 
 
42
#define NO_PACK                                 0
 
43
 
 
44
#define PACK_MASKED_8_COLORS                    1
 
45
#define PACK_MASKED_64_COLORS                   2
 
46
#define PACK_MASKED_256_COLORS                  3
 
47
#define PACK_MASKED_512_COLORS                  4
 
48
#define PACK_MASKED_4K_COLORS                   5
 
49
#define PACK_MASKED_32K_COLORS                  6
 
50
#define PACK_MASKED_64K_COLORS                  7
 
51
#define PACK_MASKED_256K_COLORS                 8
 
52
#define PACK_MASKED_2M_COLORS                   9
 
53
#define PACK_MASKED_16M_COLORS                  10
 
54
 
 
55
#define PACK_RAW_8_BITS                         3
 
56
#define PACK_RAW_16_BITS                        7
 
57
#define PACK_RAW_24_BITS                        10
 
58
 
 
59
#define PACK_COLORMAP_256_COLORS                11
 
60
 
 
61
#define PACK_JPEG_8_COLORS                      26
 
62
#define PACK_JPEG_64_COLORS                     27
 
63
#define PACK_JPEG_256_COLORS                    28
 
64
#define PACK_JPEG_512_COLORS                    29
 
65
#define PACK_JPEG_4K_COLORS                     30
 
66
#define PACK_JPEG_32K_COLORS                    31
 
67
#define PACK_JPEG_64K_COLORS                    32
 
68
#define PACK_JPEG_256K_COLORS                   33
 
69
#define PACK_JPEG_2M_COLORS                     34
 
70
#define PACK_JPEG_16M_COLORS                    35
 
71
 
 
72
#define PACK_PNG_8_COLORS                       37
 
73
#define PACK_PNG_64_COLORS                      38
 
74
#define PACK_PNG_256_COLORS                     39
 
75
#define PACK_PNG_512_COLORS                     40
 
76
#define PACK_PNG_4K_COLORS                      41
 
77
#define PACK_PNG_32K_COLORS                     42
 
78
#define PACK_PNG_64K_COLORS                     43
 
79
#define PACK_PNG_256K_COLORS                    44
 
80
#define PACK_PNG_2M_COLORS                      45
 
81
#define PACK_PNG_16M_COLORS                     46
 
82
 
 
83
#define PACK_RGB_16M_COLORS                     63
 
84
#define PACK_RLE_16M_COLORS                     64
 
85
 
 
86
#define PACK_ALPHA                              65
 
87
#define PACK_COLORMAP                           66
 
88
 
 
89
#define PACK_BITMAP_16M_COLORS                  67
 
90
 
 
91
/*
 
92
 * Not really pack methods. These values
 
93
 * allow dynamic selection of the pack
 
94
 * method by the agent.
 
95
 */
 
96
 
 
97
#define PACK_NONE                               0
 
98
#define PACK_LOSSY                              253
 
99
#define PACK_LOSSLESS                           254
 
100
#define PACK_ADAPTIVE                           255
 
101
 
 
102
/*
 
103
 * Reduce the number of colors in the
 
104
 * image by applying a mask.
 
105
 */
 
106
 
 
107
typedef struct
 
108
{
 
109
  unsigned int color_mask;
 
110
  unsigned int correction_mask;
 
111
  unsigned int white_threshold;
 
112
  unsigned int black_threshold;
 
113
 
 
114
} ColorMask;
 
115
 
 
116
extern const ColorMask Mask8TrueColor;
 
117
extern const ColorMask Mask64TrueColor;
 
118
extern const ColorMask Mask512TrueColor;
 
119
extern const ColorMask Mask4KTrueColor;
 
120
extern const ColorMask Mask32KTrueColor;
 
121
extern const ColorMask Mask256KTrueColor;
 
122
extern const ColorMask Mask2MTrueColor;
 
123
extern const ColorMask Mask16MTrueColor;
 
124
 
 
125
const ColorMask *MethodColorMask(unsigned int method);
 
126
 
 
127
int MethodBitsPerPixel(unsigned int method);
 
128
 
 
129
#ifdef __cplusplus
 
130
}
 
131
#endif
 
132
 
 
133
#endif /* NXpack_H */