Changeset 2372 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Apr 25, 2003, 3:35:30 PM (22 years ago)
Author:
ansari
Message:

Ajout nouvelles tables de couleurs (nuances de rouge/vert/bleu) - Reza 25/4/03

Location:
trunk/SophyaPI/PI
Files:
4 edited

Legend:

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

    r2322 r2372  
    2323//--
    2424
    25 #define  MXMAPIDS   22
     25#define  MXMAPIDS   26
    2626static   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 };
     27                            256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
     28256, 256, 256, 256};
    2829
    2930// Tables de couleurs :
    3031// 5 Standard PI , 32  couleurs
    3132// 4 Standard PI , 128 couleurs
     33// 4 Standard PI , 32 couleurs uniformes
    3234// 12 MIDAS , 256 couleurs
    3335// 1 Standard PI 16 couleurs
     
    3638                      "Grey32","InvGrey32","ColRJ32","ColBR32","ColRV32",
    3739                      "Grey128","InvGrey128","ColRJ128","ColBR128",
     40                      "Red32","Green32","Blue32","Yellow32",
    3841                      "MIDAS_Pastel","MIDAS_Heat","MIDAS_Rainbow3",
    3942                      "MIDAS_BlueRed","MIDAS_BlueWhite","MIDAS_Stairs8",
     
    4548                      CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32, CMAP_COLBR32, CMAP_COLRV32,
    4649                      CMAP_GREY128, CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128, 
     50                      CMAP_RED32, CMAP_GREEN32, CMAP_BLUE32, CMAP_YELLOW32,
    4751                      CMAP_MIDAS_Pastel, CMAP_MIDAS_Heat, CMAP_MIDAS_Rainbow3,
    4852                      CMAP_MIDAS_BlueRed, CMAP_MIDAS_BlueWhite, CMAP_MIDAS_Stairs8,
     
    5963                                  NULL, NULL, NULL, NULL, NULL,
    6064                                  NULL, NULL, NULL, NULL, NULL,
    61                                   NULL  };
     65                                  NULL, NULL, NULL, NULL, NULL,
     66                                  NULL, NULL, NULL, NULL, NULL,
     67                                  NULL };
    6268
    6369int  PIColorMap::NumberStandardColorMaps()
     
    101107//|     CMAP_COLRJ128   :  128 couleurs, du Rouge au Jaune/blanc
    102108//|     CMAP_COLBR128   :  128 couleurs du bleu au rouge (arcenciel)
     109//|     CMAP_RED32      :  32 couleurs, nuances de rouge
     110//|     CMAP_GREEN32    :  32 couleurs, nuances de vert
     111//|     CMAP_BLUE32     :  32 couleurs, nuances de bleu
     112//|     CMAP_YELLOW32   :  32 couleurs, nuances de jaune
    103113//|     CMAP_COL16      :  16 Couleurs arcenciel
    104114//|     CMAP_OTHER      :  Table non standard (Midas,Idl, ...)
     
    416426      }
    417427      break;
     428
     429    // Nuances de couleurs uniformes
     430    case CMAP_RED32 :
     431    case CMAP_GREEN32 :
     432    case CMAP_BLUE32 :
     433    case CMAP_YELLOW32 :
     434      for(i=0; i<6; i++) {
     435        int vcol = i*4000;
     436        mycol.red = mycol.green = mycol.blue = 0;
     437        if (mType == CMAP_RED32) mycol.red = vcol;
     438        else if (mType == CMAP_GREEN32)  mycol.green = vcol;
     439        else if (mType == CMAP_BLUE32)  mycol.blue = vcol;
     440        else if (mType == CMAP_YELLOW32) mycol.green = mycol.red = vcol;
     441        for(k=0; k<8; k++)     AllocColor(mycol, i*8+k);
     442      }
     443      for(i=6; i<16; i++) {
     444        int vcol = 20000+(i-5)*2500;
     445        mycol.red = mycol.green = mycol.blue = 0;
     446        if (mType == CMAP_RED32) mycol.red = vcol;
     447        else if (mType == CMAP_GREEN32)  mycol.green = vcol;
     448        else if (mType == CMAP_BLUE32)  mycol.blue = vcol;
     449        else if (mType == CMAP_YELLOW32) mycol.green = mycol.red = vcol;
     450        for(k=0; k<8; k++)     AllocColor(mycol, i*8+k);
     451      }
     452      for(i=16; i<32; i++) {
     453        int vcol = 45000+(i-15)*1283.4;
     454        mycol.red = mycol.green = mycol.blue = 0;
     455        if (mType == CMAP_RED32) mycol.red = vcol;
     456        else if (mType == CMAP_GREEN32)  mycol.green = vcol;
     457        else if (mType == CMAP_BLUE32)  mycol.blue = vcol;
     458        else if (mType == CMAP_YELLOW32) mycol.green = mycol.red = vcol;
     459        for(k=0; k<8; k++)     AllocColor(mycol, i*8+k);
     460      }
     461      for(i=6; i<20; i++) {
     462        mycol.green = mycol.blue = 0;
     463        mycol.red = 20000+(i-5)*2000;
     464        for(k=0; k<8; k++)     AllocColor(mycol, i*8+k);
     465      }
     466      break;
     467
     468//----------------------------------------------------------
     469//----------------------------------------------------------
    418470
    419471  case CMAP_MIDAS_Pastel :   // pastel.lutlis
  • trunk/SophyaPI/PI/picmap.h

    r1503 r2372  
    2222 CMAP_COLRJ128    = 8,     // 128 couleurs du rouge au jaune/blanc
    2323 CMAP_COLBR128    = 9,     // 128 couleurs du bleu au rouge
     24
     25 // Nuances de couleurs uniformes
     26 CMAP_RED32       = 11,    // 32 couleurs - nuances de rouge
     27 CMAP_GREEN32     = 12,    // 32 couleurs - nuances de vert
     28 CMAP_BLUE32      = 13,    // 32 couleurs - nuances de bleu
     29 CMAP_YELLOW32    = 14,    // 32 couleurs - nuances de jaune
    2430
    2531 // Tables de couleur importees de MIDAS   256 couleurs
  • trunk/SophyaPI/PI/pidrwtools.cc

    r2322 r2372  
    164164//  Groupement des tables de couleurs
    165165mCasc[0] = new PIMenu(mOpt[1]->Menu(), "PIStd-128Col");
    166 mCasc[1] = new PIMenu(mOpt[1]->Menu(), "MIDAS-CMap");
    167 
    168 int nsct1,nsct2,nsct3;
     166mCasc[1] = new PIMenu(mOpt[1]->Menu(), "PIUniCol32");
     167mCasc[2] = new PIMenu(mOpt[1]->Menu(), "MIDAS-CMap");
     168
     169int nsct1,nsct2,nsct3,nsct4;
    169170//  D'abord les tables standard de PI  32 couleurs
    170171nsct1 = 5;   // Les 5 premieres tables
     
    176177  mCasc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc);
    177178mOpt[1]->AppendPDMenu(mCasc[0]);
    178 //  Apres les tables importees de MIDAS
    179 nsct3 = PIColorMap::NumberStandardColorMaps()-1; // Les reste jusqu'a l'avant derniere
     179nsct3 = 13;  // Les 4 tables de couleurs uniforme
    180180for(kcc=nsct2; kcc<nsct3; kcc++)
    181181  mCasc[1]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc);
    182182mOpt[1]->AppendPDMenu(mCasc[1]);
     183//  Apres les tables importees de MIDAS
     184nsct4 = PIColorMap::NumberStandardColorMaps()-1; // Les reste jusqu'a l'avant derniere
     185for(kcc=nsct3; kcc<nsct4; kcc++)
     186  mCasc[2]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc);
     187mOpt[1]->AppendPDMenu(mCasc[2]);
    183188// Les tables qui restent ( Col16 , ... )
    184 for(kcc=nsct3; kcc<PIColorMap::NumberStandardColorMaps(); kcc++)
     189for(kcc=nsct4; kcc<PIColorMap::NumberStandardColorMaps(); kcc++)
    185190mOpt[1]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc);
    186191
     
    362367for(i=0; i<2; i++) delete mButdr[i];
    363368for(i=0; i<10 ; i++)  delete mOpt[i];
    364 for(i=0; i<2; i++)  delete mCasc[i];
     369for(i=0; i<3; i++)  delete mCasc[i];
    365370delete mNlb;
    366371delete mDrName;
  • trunk/SophyaPI/PI/piimgtools.cc

    r1592 r2372  
    154154//  Groupement des tables de couleurs
    155155mCasc[0] = new PIMenu(mOptzc[0]->Menu(), "PIStd-128Col");
    156 mCasc[1] = new PIMenu(mOptzc[0]->Menu(), "MIDAS-CMap");
    157 
    158 int nsct1,nsct2,nsct3;
     156mCasc[1] = new PIMenu(mOptzc[0]->Menu(), "PIUniCol32");
     157mCasc[2] = new PIMenu(mOptzc[0]->Menu(), "MIDAS-CMap");
     158
     159int nsct1,nsct2,nsct3,nsct4;
    159160//  D'abord les tables standard de PI  32 couleurs
    160161nsct1 = 5;   // Les 5 premieres tables
     
    166167  mCasc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc);
    167168mOptzc[0]->AppendPDMenu(mCasc[0]);
    168 //  Apres les tables importees de MIDAS
    169 nsct3 = PIColorMap::NumberStandardColorMaps()-1; // Les reste jusqu'a l'avant derniere
     169nsct3 = 13;  // Les 4 tables de couleurs uniforme
    170170for(kcc=nsct2; kcc<nsct3; kcc++)
    171171  mCasc[1]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc);
    172172mOptzc[0]->AppendPDMenu(mCasc[1]);
     173//  Apres les tables importees de MIDAS
     174nsct4 = PIColorMap::NumberStandardColorMaps()-1; // Les reste jusqu'a l'avant derniere
     175for(kcc=nsct3; kcc<nsct4; kcc++)
     176  mCasc[2]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc);
     177mOptzc[0]->AppendPDMenu(mCasc[2]);
    173178// Les tables qui restent ( Col16 , ... )
    174 for(kcc=nsct3; kcc<PIColorMap::NumberStandardColorMaps(); kcc++)
     179for(kcc=nsct4; kcc<PIColorMap::NumberStandardColorMaps(); kcc++)
    175180mOptzc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc);
    176181// On ajoute un CheckItem pour inverser les index de table de couleur
Note: See TracChangeset for help on using the changeset viewer.