/[projet1]/public/pc/tools/osdk/main/pictconv/sources/dithering.cpp
Defence Force logotype

Contents of /public/pc/tools/osdk/main/pictconv/sources/dithering.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1174 - (show annotations)
Wed Sep 17 19:35:59 2014 UTC (4 years, 11 months ago) by Jylam
File size: 946 byte(s)
Fix gcc warnings in pictconv

1
2
3 #include "dithering.h"
4
5
6 //
7 // 16 bits suffisent à rajouter +1/0 pour une composante aux coordonnées (x,y)
8 // Il faut 8 valeurs 16 bits pour récupérer la partie de poids faible
9 //
10 unsigned short DitherMask[9];
11 //unsigned char DitherTable[16*2][256];
12
13
14 void ComputeDitherMask(long position,const char *chaine)
15 {
16 unsigned short value=0;
17 for (long i=0;i<16;i++)
18 {
19 if (chaine[i]!=' ')
20 {
21 value|=(1<<i);
22 }
23 }
24 DitherMask[position]=value;
25 }
26
27
28
29 void GenerateDitherTable()
30 {
31 //
32 // Calcule les masques de tramage
33 //
34 ComputeDitherMask(0," ");
35 ComputeDitherMask(1,"X X ");
36 ComputeDitherMask(2,"X X X X ");
37 ComputeDitherMask(3,"X X X X X X");
38 ComputeDitherMask(4,"X X X XX X X X");
39 ComputeDitherMask(5,"X XX X XXXX X X");
40 ComputeDitherMask(6,"XXXX X XXXXX X X");
41 ComputeDitherMask(7,"XXXX XXXXXXXXX X");
42 ComputeDitherMask(8,"XXXXxXXXXXXXXXxX");
43 }

  ViewVC Help
Powered by ViewVC 1.1.26