Changeset 1124 in Sophya for trunk/SophyaPI/PI/picmap.cc


Ignore:
Timestamp:
Aug 1, 2000, 1:05:06 PM (25 years ago)
Author:
ercodmgr
Message:

Ajout PIOptMenuGen::AppendPDMenu() - Possibilite d'avoir des sous-menu

ds le menu d'une Option-Widget

Suite des modifications d'ajout de tables de couleurs - Adaptation

de PIImageTools et PIDrawerTools

Amelioration de la table standard ColRV32

Reza 1/8/2000

File:
1 edited

Legend:

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

    r1122 r1124  
    2222//--
    2323
    24 #define  MXMAPIDS   15
     24#define  MXMAPIDS   16
    2525static   int    MapNCols[MXMAPIDS] = {256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
    26                                       256, 256, 256, 256, 256 };
    27 static   const char*  MapNoms[MXMAPIDS]  = {"Grey32","InvGrey32","ColRJ32","ColBR32",
    28                                "ColRV32", "Grey128", "InvGrey128", "ColRJ128",
    29                                "ColBR128", "Col16",
    30                                "MIDAS_Pastel", "MIDAS_Heat", "MIDAS_Rainbow3",
    31                                "MIDAS_BlueRed", "MIDAS_BlueWhite" };
    32 static   CMapId MapIds[MXMAPIDS] = { CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32,
    33                                CMAP_COLBR32, CMAP_COLRV32, CMAP_GREY128,
    34                                CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128, 
    35                                CMAP_COL16,
    36                                CMAP_MIDAS_Pastel, CMAP_MIDAS_Heat, CMAP_MIDAS_Rainbow3,
    37                                CMAP_MIDAS_BlueRed, CMAP_MIDAS_BlueWhite } ;
     26                                      256, 256, 256, 256, 256, 256 };
     27
     28// Tables de couleurs :
     29// 5 Standard PI , 32  couleurs
     30// 4 Standard PI , 128 couleurs
     31// 6 MIDAS , 256 couleurs
     32// 1 Standard PI 16 couleurs
     33
     34static   const char*  MapNoms[MXMAPIDS]  = {
     35                      "Grey32","InvGrey32","ColRJ32","ColBR32","ColRV32",
     36                      "Grey128","InvGrey128","ColRJ128","ColBR128",
     37                      "MIDAS_Pastel","MIDAS_Heat","MIDAS_Rainbow3",
     38                      "MIDAS_BlueRed","MIDAS_BlueWhite","MIDAS_RedWhite",
     39                      "Rainbow16"};
     40
     41static   CMapId MapIds[MXMAPIDS] = {
     42                      CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32, CMAP_COLBR32, CMAP_COLRV32,
     43                      CMAP_GREY128, CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128, 
     44                      CMAP_MIDAS_Pastel, CMAP_MIDAS_Heat, CMAP_MIDAS_Rainbow3,
     45                      CMAP_MIDAS_BlueRed, CMAP_MIDAS_BlueWhite, CMAP_MIDAS_RedWhite,
     46                      CMAP_COL16 } ;
    3847
    3948static   int mColTNums[8192];   // Max 8192 tables differentes pour le moment 
     
    4150
    4251static   int NMaxTableAuto = 0;
    43 static   PIColorMap* mMaps[15] = {NULL, NULL, NULL, NULL, NULL,
     52static   PIColorMap* mMaps[MXMAPIDS] = {
    4453                                  NULL, NULL, NULL, NULL, NULL,
    45                                   NULL, NULL, NULL, NULL, NULL  };
     54                                  NULL, NULL, NULL, NULL, NULL,
     55                                  NULL, NULL, NULL, NULL, NULL,
     56                                  NULL  };
    4657
    4758int  PIColorMap::NumberStandardColorMaps()
     
    308319  case CMAP_COLRV32 :
    309320    for( i=0; i<32; i++) {
    310       if (i < 8) {
    311         mycol.green = 15000+(i*5000); mycol.blue = 0; 
    312         mycol.red = 15000+(i*5000); }
     321      if (i < 9) {
     322        mycol.green = i*5000; mycol.blue = 0; 
     323        mycol.red = i*6000; }
     324      else if (i < 15) {
     325        mycol.green = 40000;
     326        mycol.blue = 0; 
     327        mycol.red = 50000+(i-9)*1000;
     328      }
    313329      else if (i < 21) {
    314         mycol.green = 50000-(i-7)*5000;   
    315         if (mycol.green < 0)  mycol.green = 0;
     330        mycol.green = 40000-(i-15)*8000;
    316331        mycol.blue = 0;
    317         mycol.red = 53535+(i-8)*1000;  }
     332        mycol.red = 57535+(i-15)*1600;  }
    318333      else {
    319334        mycol.green = 0;  mycol.red = 65535;
     
    388403      break;
    389404
    390   case CMAP_MIDAS_Pastel :   // Les valeurs correspondent a  je ne sais quel table MIDAS
     405  case CMAP_MIDAS_Pastel :   //
    391406  case CMAP_MIDAS_Heat :      // A faire  pour CMAP_MIDAS_Pastel CMAP_MIDAS_Heat
    392407  case CMAP_MIDAS_Rainbow3 :  //    A faire  pour Heat Rainbow3 BlueRed BlueWhite
    393408  case CMAP_MIDAS_BlueRed :   //    BlueRed -> idl11
    394409  case CMAP_MIDAS_BlueWhite : //    BlueWhite -> blulut.lutlis
     410  case CMAP_MIDAS_RedWhite :  // rouge-rose-blanc je ne sais quelle table MIDAS ??   
    395411   {
    396     static float rgb_r[256] = {
     412   float rgb_r[256] = {
    3974130, 0, 0.01961, 0.0549, 0.08627, 0.1098, 0.13725, 0.15686, 0.18039, 0.2,
    3984140.21569, 0.23529, 0.25098, 0.26275, 0.28235, 0.29412, 0.30588, 0.31765,
     
    4274430.98824, 0.99216, 0.99216, 0.99216, 0.99216, 0.99608, 0.99608, 0.99608,
    4284440.99608, 1, 1 };
    429     static float rgb_g[256] = {
     445    float rgb_g[256] = {
    4304460, 0, 0, 0, 0.00392, 0.00392, 0.00392, 0.00392, 0.00392, 0.00784,
    4314470.00784, 0.00784, 0.00784, 0.01176, 0.01176, 0.01176, 0.01176, 0.01176,
     
    4604760.89804, 0.9098, 0.91765, 0.92941, 0.94118, 0.94902, 0.96078, 0.97255,
    4614770.98039, 0.99216 };
    462     static float rgb_b[256] = {
     478    float rgb_b[256] = {
    4634790, 0, 0, 0, 0.00392, 0.00392, 0.00392, 0.00392, 0.00392, 0.00784,
    4644800.00784, 0.00784, 0.00784, 0.01176, 0.01176, 0.01176, 0.01176, 0.01176,
Note: See TracChangeset for help on using the changeset viewer.