~paulliu/ubuntu/precise/freerdp/fixext

« back to all changes in this revision

Viewing changes to libfreerdp/bitmap.c

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2010-10-25 14:29:02 UTC
  • mto: (9.1.1 sid) (1.1.7)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20101025142902-j8hmshnnxhu61l4m
Tags: upstream-0.8.1
ImportĀ upstreamĀ versionĀ 0.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        uint8 *end = input + size;
71
71
        uint8 *prevline = NULL, *line = NULL;
72
72
        int opcode, count, offset, isfillormix, x = width;
73
 
        int lastopcode = -1, insertmix = False, bicolour = False;
 
73
        int lastopcode = -1, insertmix = False, bicolor = False;
74
74
        uint8 code;
75
 
        uint8 colour1 = 0, colour2 = 0;
 
75
        uint8 color1 = 0, color2 = 0;
76
76
        uint8 mixmask, mask = 0;
77
77
        uint8 mix = 0xff;
78
78
        int fom_mask = 0;
134
134
                                if ((lastopcode == opcode) && !((x == width) && (prevline == NULL)))
135
135
                                        insertmix = True;
136
136
                                break;
137
 
                        case 8: /* Bicolour */
138
 
                                colour1 = CVAL(input);
 
137
                        case 8: /* Bicolor */
 
138
                                color1 = CVAL(input);
139
139
                        case 3: /* Colour */
140
 
                                colour2 = CVAL(input);
 
140
                                color2 = CVAL(input);
141
141
                                break;
142
142
                        case 6: /* SetMix/Mix */
143
143
                        case 7: /* SetMix/FillOrMix */
226
226
                                        }
227
227
                                        break;
228
228
                                case 3: /* Colour */
229
 
                                        REPEAT(line[x] = colour2)
 
229
                                        REPEAT(line[x] = color2)
230
230
                                        break;
231
231
                                case 4: /* Copy */
232
232
                                        REPEAT(line[x] = CVAL(input))
233
233
                                        break;
234
 
                                case 8: /* Bicolour */
 
234
                                case 8: /* Bicolor */
235
235
                                        REPEAT
236
236
                                        (
237
 
                                                if (bicolour)
 
237
                                                if (bicolor)
238
238
                                                {
239
 
                                                        line[x] = colour2;
240
 
                                                        bicolour = False;
 
239
                                                        line[x] = color2;
 
240
                                                        bicolor = False;
241
241
                                                }
242
242
                                                else
243
243
                                                {
244
 
                                                        line[x] = colour1;
245
 
                                                        bicolour = True; count++;
 
244
                                                        line[x] = color1;
 
245
                                                        bicolor = True; count++;
246
246
                                                }
247
247
                                        )
248
248
                                        break;
268
268
        uint8 *end = input + size;
269
269
        uint16 *prevline = NULL, *line = NULL;
270
270
        int opcode, count, offset, isfillormix, x = width;
271
 
        int lastopcode = -1, insertmix = False, bicolour = False;
 
271
        int lastopcode = -1, insertmix = False, bicolor = False;
272
272
        uint8 code;
273
 
        uint16 colour1 = 0, colour2 = 0;
 
273
        uint16 color1 = 0, color2 = 0;
274
274
        uint8 mixmask, mask = 0;
275
275
        uint16 mix = 0xffff;
276
276
        int fom_mask = 0;
332
332
                                if ((lastopcode == opcode) && !((x == width) && (prevline == NULL)))
333
333
                                        insertmix = True;
334
334
                                break;
335
 
                        case 8: /* Bicolour */
336
 
                                CVAL2(input, colour1);
 
335
                        case 8: /* Bicolor */
 
336
                                CVAL2(input, color1);
337
337
                        case 3: /* Colour */
338
 
                                CVAL2(input, colour2);
 
338
                                CVAL2(input, color2);
339
339
                                break;
340
340
                        case 6: /* SetMix/Mix */
341
341
                        case 7: /* SetMix/FillOrMix */
424
424
                                        }
425
425
                                        break;
426
426
                                case 3: /* Colour */
427
 
                                        REPEAT(line[x] = colour2)
 
427
                                        REPEAT(line[x] = color2)
428
428
                                        break;
429
429
                                case 4: /* Copy */
430
430
                                        REPEAT(CVAL2(input, line[x]))
431
431
                                        break;
432
 
                                case 8: /* Bicolour */
 
432
                                case 8: /* Bicolor */
433
433
                                        REPEAT
434
434
                                        (
435
 
                                                if (bicolour)
 
435
                                                if (bicolor)
436
436
                                                {
437
 
                                                        line[x] = colour2;
438
 
                                                        bicolour = False;
 
437
                                                        line[x] = color2;
 
438
                                                        bicolor = False;
439
439
                                                }
440
440
                                                else
441
441
                                                {
442
 
                                                        line[x] = colour1;
443
 
                                                        bicolour = True;
 
442
                                                        line[x] = color1;
 
443
                                                        bicolor = True;
444
444
                                                        count++;
445
445
                                                }
446
446
                                        )
467
467
        uint8 *end = input + size;
468
468
        uint8 *prevline = NULL, *line = NULL;
469
469
        int opcode, count, offset, isfillormix, x = width;
470
 
        int lastopcode = -1, insertmix = False, bicolour = False;
 
470
        int lastopcode = -1, insertmix = False, bicolor = False;
471
471
        uint8 code;
472
 
        uint8 colour1[3] = {0, 0, 0}, colour2[3] = {0, 0, 0};
 
472
        uint8 color1[3] = {0, 0, 0}, color2[3] = {0, 0, 0};
473
473
        uint8 mixmask, mask = 0;
474
474
        uint8 mix[3] = {0xff, 0xff, 0xff};
475
475
        int fom_mask = 0;
532
532
                                if ((lastopcode == opcode) && !((x == width) && (prevline == NULL)))
533
533
                                        insertmix = True;
534
534
                                break;
535
 
                        case 8: /* Bicolour */
536
 
                                colour1[0] = CVAL(input);
537
 
                                colour1[1] = CVAL(input);
538
 
                                colour1[2] = CVAL(input);
 
535
                        case 8: /* Bicolor */
 
536
                                color1[0] = CVAL(input);
 
537
                                color1[1] = CVAL(input);
 
538
                                color1[2] = CVAL(input);
539
539
                        case 3: /* Colour */
540
 
                                colour2[0] = CVAL(input);
541
 
                                colour2[1] = CVAL(input);
542
 
                                colour2[2] = CVAL(input);
 
540
                                color2[0] = CVAL(input);
 
541
                                color2[1] = CVAL(input);
 
542
                                color2[2] = CVAL(input);
543
543
                                break;
544
544
                        case 6: /* SetMix/Mix */
545
545
                        case 7: /* SetMix/FillOrMix */
666
666
                                                        MASK_UPDATE();
667
667
                                                        if (mask & mixmask)
668
668
                                                        {
669
 
                                                                line[x * 3] = 
 
669
                                                                line[x * 3] =
670
670
                                                                 prevline[x * 3] ^ mix [0];
671
671
                                                                line[x * 3 + 1] =
672
672
                                                                 prevline[x * 3 + 1] ^ mix [1];
688
688
                                case 3: /* Colour */
689
689
                                        REPEAT
690
690
                                        (
691
 
                                                line[x * 3] = colour2 [0];
692
 
                                                line[x * 3 + 1] = colour2 [1];
693
 
                                                line[x * 3 + 2] = colour2 [2];
 
691
                                                line[x * 3] = color2 [0];
 
692
                                                line[x * 3 + 1] = color2 [1];
 
693
                                                line[x * 3 + 2] = color2 [2];
694
694
                                        )
695
695
                                        break;
696
696
                                case 4: /* Copy */
701
701
                                                line[x * 3 + 2] = CVAL(input);
702
702
                                        )
703
703
                                        break;
704
 
                                case 8: /* Bicolour */
 
704
                                case 8: /* Bicolor */
705
705
                                        REPEAT
706
706
                                        (
707
 
                                                if (bicolour)
 
707
                                                if (bicolor)
708
708
                                                {
709
 
                                                        line[x * 3] = colour2[0];
710
 
                                                        line[x * 3 + 1] = colour2[1];
711
 
                                                        line[x * 3 + 2] = colour2[2];
712
 
                                                        bicolour = False;
 
709
                                                        line[x * 3] = color2[0];
 
710
                                                        line[x * 3 + 1] = color2[1];
 
711
                                                        line[x * 3 + 2] = color2[2];
 
712
                                                        bicolor = False;
713
713
                                                }
714
714
                                                else
715
715
                                                {
716
 
                                                        line[x * 3] = colour1[0];
717
 
                                                        line[x * 3 + 1] = colour1[1];
718
 
                                                        line[x * 3 + 2] = colour1[2];
719
 
                                                        bicolour = True;
 
716
                                                        line[x * 3] = color1[0];
 
717
                                                        line[x * 3 + 1] = color1[1];
 
718
                                                        line[x * 3 + 2] = color1[2];
 
719
                                                        bicolor = True;
720
720
                                                        count++;
721
721
                                                }
722
722
                                        )
746
746
        return True;
747
747
}
748
748
 
749
 
/* decompress a colour plane */
 
749
/* decompress a color plane */
750
750
static int
751
751
process_plane(uint8 * in, int width, int height, uint8 * out, int size)
752
752
{