/[rdesktop]/sourceforge.net/trunk/rdesktop/bitmap.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/bitmap.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 317 by jsorg71, Fri Feb 7 23:43:37 2003 UTC revision 318 by astrand, Mon Feb 10 12:58:51 2003 UTC
# Line 22  Line 22 
22    
23  #define CVAL(p)   (*(p++))  #define CVAL(p)   (*(p++))
24    
25  uint32 cvalx(unsigned char **input, int Bpp)  uint32
26    cvalx(unsigned char **input, int Bpp)
27  {  {
28          uint32 rv = 0;          uint32 rv = 0;
29          memcpy(&rv, *input, Bpp);          memcpy(&rv, *input, Bpp);
# Line 30  uint32 cvalx(unsigned char **input, int Line 31  uint32 cvalx(unsigned char **input, int
31          return rv;          return rv;
32  }  }
33    
34  void setli(unsigned char * input, int offset, uint32 value, int Bpp)  void
35    setli(unsigned char *input, int offset, uint32 value, int Bpp)
36  {  {
37          input += offset * Bpp;          input += offset * Bpp;
38          memcpy(input, &value, Bpp);          memcpy(input, &value, Bpp);
39  }  }
40    
41  uint32 getli(unsigned char * input, int offset, int Bpp)  uint32
42    getli(unsigned char *input, int offset, int Bpp)
43  {  {
44          uint32 rv = 0;          uint32 rv = 0;
45          input += offset * Bpp;          input += offset * Bpp;
# Line 65  uint32 getli(unsigned char * input, int Line 68  uint32 getli(unsigned char * input, int
68  }  }
69    
70  BOOL  BOOL
71  bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input, int size, int Bpp)  bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input, int size,
72                      int Bpp)
73  {  {
74          unsigned char *end = input + size;          unsigned char *end = input + size;
75          unsigned char *prevline = NULL, *line = NULL;          unsigned char *prevline = NULL, *line = NULL;
# Line 189  bitmap_decompress(unsigned char *output, Line 193  bitmap_decompress(unsigned char *output,
193                                                  if (prevline == NULL)                                                  if (prevline == NULL)
194                                                          setli(line, x, mix, Bpp);                                                          setli(line, x, mix, Bpp);
195                                                  else                                                  else
196                                                          setli(line, x, getli(prevline, x, Bpp) ^ mix, Bpp);                                                          setli(line, x,
197                                                                  getli(prevline, x, Bpp) ^ mix, Bpp);
198    
199                                                  insertmix = False;                                                  insertmix = False;
200                                                  count--;                                                  count--;
# Line 198  bitmap_decompress(unsigned char *output, Line 203  bitmap_decompress(unsigned char *output,
203    
204                                          if (prevline == NULL)                                          if (prevline == NULL)
205                                          {                                          {
206                                                  REPEAT(setli(line, x, 0, Bpp))                                          REPEAT(setli(line, x, 0, Bpp))}
                                         }  
207                                          else                                          else
208                                          {                                          {
209                                                  REPEAT(setli(line, x, getli(prevline, x, Bpp), Bpp));                                                  REPEAT(setli
210                                                           (line, x, getli(prevline, x, Bpp), Bpp));
211                                          }                                          }
212                                          break;                                          break;
213    
# Line 213  bitmap_decompress(unsigned char *output, Line 218  bitmap_decompress(unsigned char *output,
218                                          }                                          }
219                                          else                                          else
220                                          {                                          {
221                                                  REPEAT(setli(line, x, getli(prevline, x, Bpp) ^ mix, Bpp));                                                  REPEAT(setli
222                                                           (line, x, getli(prevline, x, Bpp) ^ mix,
223                                                            Bpp));
224                                          }                                          }
225                                          break;                                          break;
226    
# Line 229  bitmap_decompress(unsigned char *output, Line 236  bitmap_decompress(unsigned char *output,
236                                          {                                          {
237                                                  REPEAT(MASK_UPDATE();                                                  REPEAT(MASK_UPDATE();
238                                                         if (mask & mixmask)                                                         if (mask & mixmask)
239                                                         setli(line, x, getli(prevline, x, Bpp) ^ mix, Bpp);                                                         setli(line, x, getli(prevline, x, Bpp) ^ mix,
240                                                                 Bpp);
241                                                         else                                                         else
242                                                         setli(line, x, getli(prevline, x, Bpp), Bpp););                                                         setli(line, x, getli(prevline, x, Bpp),
243                                                                 Bpp););
244                                          }                                          }
245                                          break;                                          break;
246    
# Line 249  bitmap_decompress(unsigned char *output, Line 258  bitmap_decompress(unsigned char *output,
258                                                 setli(line, x, colour2, Bpp); bicolour = False;}                                                 setli(line, x, colour2, Bpp); bicolour = False;}
259                                                 else                                                 else
260                                                 {                                                 {
261                                                 setli(line, x, colour1, Bpp); bicolour = True; count++;}                                                 setli(line, x, colour1, Bpp); bicolour = True;
262                                                   count++;}
263                                          );                                          );
264                                          break;                                          break;
265    
# Line 270  bitmap_decompress(unsigned char *output, Line 280  bitmap_decompress(unsigned char *output,
280    
281          return True;          return True;
282  }  }
   

Legend:
Removed from v.317  
changed lines
  Added in v.318

  ViewVC Help
Powered by ViewVC 1.1.26