Changeset 2379 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
May 15, 2003, 3:47:07 PM (22 years ago)
Author:
ansari
Message:

Ajout colormap MultiCol64 et petites corrections - Reza 15/5/2003

Location:
trunk/SophyaPI/PI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/picmap.cc

    r2378 r2379  
    2424
    2525#define  MXMAPIDS   30
    26 static   int    MapNCols[MXMAPIDS] = {256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
    27                             256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
    28 256, 256, 256, 256, 256};
     26static   int    MapNCols[MXMAPIDS] = {
     27  256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
     28  256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
     29  256, 256, 256, 256, 256, 256, 256, 256, 256, 256  };
    2930
    3031// Tables de couleurs :
     
    3334// 7 Standard PI , 32 couleurs uniformes
    3435// 12 MIDAS , 256 couleurs
    35 // 1 Standard PI 256 couleurs arcenciel avec intensites
     36// 1 Standard PI 64 couleurs differentes
    3637// 1 Standard PI 16 couleurs
    3738
     
    4546                      "MIDAS_Stairs9","MIDAS_StairCase","MIDAS_Color",
    4647                      "MIDAS_ManyCol","MIDAS_Idl14","MIDAS_Idl15",
    47                       "Rainbow256","Rainbow16"};
     48                      "MultiCol16","MultiCol64"};
    4849
    4950static   CMapId MapIds[MXMAPIDS] = {
     
    5657                      CMAP_MIDAS_Stairs9, CMAP_MIDAS_StairCase, CMAP_MIDAS_Color,
    5758                      CMAP_MIDAS_ManyCol, CMAP_MIDAS_Idl14, CMAP_MIDAS_Idl15,
    58                       CMAP_Rainbow256, CMAP_COL16 } ;
     59                      CMAP_COL16, CMAP_COL64 } ;
    5960
    6061static   int mColTNums[8192];   // Max 8192 tables differentes pour le moment 
     
    117118//|     CMAP_CYAN32     :  32 couleurs, nuances de cyan
    118119//|     CMAP_VIOLET32   :  32 couleurs, nuances de violet
    119 //|     CMAP_Rainbow256 :  256 Couleurs arcenciel avec intensites
    120120//|     CMAP_COL16      :  16 Couleurs arcenciel
    121 //|     CMAP_OTHER      :  Table non standard (Midas,Idl, ...)
     121//|     CMAP_COL64      :  64 Couleurs arcenciel
     122//|     CMAP_OTHER      :  Table non standard
    122123//      Toutes les tables de couleurs standard possèdent 256 cellules de couleurs,
    123124//      contenant 16 ou 32 ou 128 couleurs distinctes.
     
    275276{
    276277  PIColor mycol;
    277   int i,j,k;
     278  int i,k;
    278279
    279280  switch (mType) {
     
    483484      break;
    484485
    485     case CMAP_Rainbow256 :
     486    case CMAP_COL64 :
    486487      {
    487         double fci[8] = {0.1, 0.6, 0.8, 1.0, 0.7, 0.8, 0.9, 1.0};
    488         for(i=0; i<256; i++) {
    489           int ki = i/64;
    490           int kc = i%64;
    491           int kr = kc%4;
    492           kc = kc/4;
    493           int kg = kc%4;
    494           int kb = kc/4;
    495           mycol.red = (fci[kr]*fci[ki]*65000.);
    496           mycol.green = (fci[kg]*fci[ki]*65000.);
    497           mycol.blue = (fci[kb]*fci[ki]*65000.);
    498           AllocColor(mycol, i);   
     488        float fci_1[5] = { 0.60, 0.70, 0.80, 0.90, 1.0};
     489        float fci_21[8] = { 1.0, 1.0, 1.0, 1.0, 0.8, 0.6, 0.4 };
     490        float fci_22[8] = { 0.4, 0.6, 0.8, 1.0, 1.0, 1.0, 1.0 };
     491        float fci_3[3] = { 0.4, 0.80, 1.0 };
     492        i = 0;
     493        int i1,i2,i3,ici;
     494        // D'abord le noir (+1 comb)
     495        mycol.red = mycol.green = mycol.blue = 0;
     496        for(ici=0; ici<4; ici++) {
     497          AllocColor(mycol, i); i++;
    499498        }
     499        // les rouges (+5 comb)
     500        mycol.green =  mycol.blue = 0;
     501        for(i1=0; i1<5; i1++) { 
     502          mycol.red = fci_1[i1]*65530.; 
     503          for(ici=0; ici<4; ici++) {
     504            AllocColor(mycol, i); i++;
     505          }
     506        }
     507        // Ensuite, rouge+vert (+7 comb)
     508        mycol.blue = 0;
     509        for(i1=0; i1<7; i1++) {
     510          mycol.red = fci_21[i1]*65530.; 
     511          mycol.green = fci_22[i1]*65530.; 
     512          for(ici=0; ici<4; ici++) {
     513            AllocColor(mycol, i); i++;
     514          }
     515        }
     516        // Ensuite les verts (+5 comb)
     517        mycol.red =  mycol.blue = 0;
     518        for(i1=0; i1<5; i1++) { 
     519          mycol.green = fci_1[i1]*65530.; 
     520          for(ici=0; ici<4; ici++) {
     521            AllocColor(mycol, i); i++;
     522          }
     523        }
     524        // Ensuite les verts+bleu (+7 comb)
     525        mycol.red = 0;
     526        for(i1=0; i1<7; i1++) {
     527          mycol.green = fci_21[i1]*65530.; 
     528          mycol.blue = fci_22[i1]*65530.; 
     529          for(ici=0; ici<4; ici++) {
     530            AllocColor(mycol, i); i++;
     531          }
     532        }
     533        // Ensuite les bleus (+5 comb)
     534        mycol.red =  mycol.green = 0;
     535        for(i1=0; i1<5; i1++) { 
     536          mycol.blue = fci_1[i1]*65530.; 
     537          for(ici=0; ici<4; ici++) {
     538            AllocColor(mycol, i); i++;
     539          }
     540        }
     541        // Ensuite les bleu+rouge (+7 comb)
     542        mycol.green = 0;
     543        for(i1=0; i1<7; i1++) {
     544          mycol.blue = fci_21[i1]*65530.; 
     545          mycol.red = fci_22[i1]*65530.; 
     546          for(ici=0; ici<4; ici++) {
     547            AllocColor(mycol, i); i++;
     548          }
     549        }
     550        // Ensuite les bleu+rouge+vert (+27 comb)
     551        for(i1=0; i1<3; i1++)   
     552          for(i2=0; i2<3; i2++)   
     553            for(i3=0; i3<3; i3++) {
     554              mycol.red = fci_3[i1]*65530.; 
     555              mycol.green = fci_3[i2]*65530.; 
     556              mycol.blue = fci_3[i3]*65530.; 
     557              for(ici=0; ici<4; ici++) {
     558                AllocColor(mycol, i); i++;
     559              }
     560            }   
     561        //      cout << "PICMAP-Rainbow256 - NbColors allocated= " << i << endl;
    500562      }
    501563      break;
  • trunk/SophyaPI/PI/picmap.h

    r2378 r2379  
    4646 CMAP_MIDAS_Idl15     = 112,  //  (idl15.lutlis)
    4747
    48  //  Table simple a 16 couleurs
    49  CMAP_Rainbow256  = 777,       // 256 Couleurs Arcenciel/intensite
    50  CMAP_COL16       = 999        // 16 Couleurs Arcenciel
     48 //  Table simple a 16/64 couleurs
     49 CMAP_COL16       = 998,        // 16 Couleurs arcenciel
     50 CMAP_COL64       = 999         // 64 Couleurs differentes
    5151 };
    5252
Note: See TracChangeset for help on using the changeset viewer.