/[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 81 by matty, Sat Sep 15 14:30:46 2001 UTC revision 82 by astrand, Tue Jul 30 07:18:48 2002 UTC
# Line 43  Line 43 
43  }  }
44    
45  BOOL  BOOL
46  bitmap_decompress(unsigned char *output, int width, int height,  bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input, int size)
                   unsigned char *input, int size)  
47  {  {
48          unsigned char *end = input + size;          unsigned char *end = input + size;
49          unsigned char *prevline = NULL, *line = NULL;          unsigned char *prevline = NULL, *line = NULL;
# Line 114  bitmap_decompress(unsigned char *output, Line 113  bitmap_decompress(unsigned char *output,
113                  switch (opcode)                  switch (opcode)
114                  {                  {
115                          case 0: /* Fill */                          case 0: /* Fill */
116                                  if ((lastopcode == opcode)                                  if ((lastopcode == opcode) && !((x == width) && (prevline == NULL)))
                                     && !((x == width) && (prevline == NULL)))  
117                                          insertmix = True;                                          insertmix = True;
118                                  break;                                  break;
119                          case 8: /* Bicolour */                          case 8: /* Bicolour */
# Line 167  bitmap_decompress(unsigned char *output, Line 165  bitmap_decompress(unsigned char *output,
165                                                  if (prevline == NULL)                                                  if (prevline == NULL)
166                                                          line[x] = mix;                                                          line[x] = mix;
167                                                  else                                                  else
168                                                          line[x] =                                                          line[x] = prevline[x] ^ mix;
                                                                 prevline[x] ^  
                                                                 mix;  
169    
170                                                  insertmix = False;                                                  insertmix = False;
171                                                  count--;                                                  count--;
# Line 193  bitmap_decompress(unsigned char *output, Line 189  bitmap_decompress(unsigned char *output,
189                                          }                                          }
190                                          else                                          else
191                                          {                                          {
192                                                  REPEAT(line[x] =                                                  REPEAT(line[x] = prevline[x] ^ mix);
                                                        prevline[x] ^ mix);  
193                                          }                                          }
194                                          break;                                          break;
195    
# Line 202  bitmap_decompress(unsigned char *output, Line 197  bitmap_decompress(unsigned char *output,
197                                          if (prevline == NULL)                                          if (prevline == NULL)
198                                          {                                          {
199                                                  REPEAT(MASK_UPDATE();                                                  REPEAT(MASK_UPDATE();
200                                                         if (mask & mixmask)                                                         if (mask & mixmask) line[x] = mix;
                                                        line[x] = mix;  
201                                                         else                                                         else
202                                                         line[x] = 0;);                                                         line[x] = 0;);
203                                          }                                          }
# Line 211  bitmap_decompress(unsigned char *output, Line 205  bitmap_decompress(unsigned char *output,
205                                          {                                          {
206                                                  REPEAT(MASK_UPDATE();                                                  REPEAT(MASK_UPDATE();
207                                                         if (mask & mixmask)                                                         if (mask & mixmask)
208                                                         line[x] =                                                         line[x] = prevline[x] ^ mix;
                                                        prevline[x] ^ mix;  
209                                                         else                                                         else
210                                                         line[x] =                                                         line[x] = prevline[x];);
                                                        prevline[x];);  
211                                          }                                          }
212                                          break;                                          break;
213    
# Line 230  bitmap_decompress(unsigned char *output, Line 222  bitmap_decompress(unsigned char *output,
222                                  case 8: /* Bicolour */                                  case 8: /* Bicolour */
223                                          REPEAT(if (bicolour)                                          REPEAT(if (bicolour)
224                                                 {                                                 {
225                                                 line[x] = colour2;                                                 line[x] = colour2; bicolour = False;}
                                                bicolour = False;}  
226                                                 else                                                 else
227                                                 {                                                 {
228                                                 line[x] = colour1;                                                 line[x] = colour1; bicolour = True; count++;}
                                                bicolour = True; count++;}  
229                                          );                                          );
230                                          break;                                          break;
231    
# Line 248  bitmap_decompress(unsigned char *output, Line 238  bitmap_decompress(unsigned char *output,
238                                          break;                                          break;
239    
240                                  default:                                  default:
241                                          unimpl("bitmap opcode 0x%x\n",                                          unimpl("bitmap opcode 0x%x\n", opcode);
                                                opcode);  
242                                          return False;                                          return False;
243                          }                          }
244                  }                  }

Legend:
Removed from v.81  
changed lines
  Added in v.82

  ViewVC Help
Powered by ViewVC 1.1.26