Changeset 1122 in Sophya
- Timestamp:
- Jul 31, 2000, 7:07:02 PM (25 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/picmap.cc
r190 r1122 22 22 //-- 23 23 24 #define MXMAPIDS 10 25 static int MapNCols[MXMAPIDS] = {256, 256, 256, 256, 256, 256, 256, 256, 256, 256}; 24 #define MXMAPIDS 15 25 static int MapNCols[MXMAPIDS] = {256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 26 256, 256, 256, 256, 256 }; 26 27 static const char* MapNoms[MXMAPIDS] = {"Grey32","InvGrey32","ColRJ32","ColBR32", 27 28 "ColRV32", "Grey128", "InvGrey128", "ColRJ128", 28 "ColBR128", "Col16"}; 29 "ColBR128", "Col16", 30 "MIDAS_Pastel", "MIDAS_Heat", "MIDAS_Rainbow3", 31 "MIDAS_BlueRed", "MIDAS_BlueWhite" }; 29 32 static CMapId MapIds[MXMAPIDS] = { CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32, 30 33 CMAP_COLBR32, CMAP_COLRV32, CMAP_GREY128, 31 34 CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128, 32 CMAP_COL16 } ; 35 CMAP_COL16, 36 CMAP_MIDAS_Pastel, CMAP_MIDAS_Heat, CMAP_MIDAS_Rainbow3, 37 CMAP_MIDAS_BlueRed, CMAP_MIDAS_BlueWhite } ; 33 38 34 39 static int mColTNums[8192]; // Max 8192 tables differentes pour le moment … … 36 41 37 42 static int NMaxTableAuto = 0; 38 static PIColorMap* mMaps[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL }; 43 static PIColorMap* mMaps[15] = {NULL, NULL, NULL, NULL, NULL, 44 NULL, NULL, NULL, NULL, NULL, 45 NULL, NULL, NULL, NULL, NULL }; 46 47 int PIColorMap::NumberStandardColorMaps() 48 { 49 return ( MXMAPIDS ); 50 } 51 52 CMapId PIColorMap::GetStandardColorMapId(int num) 53 { 54 if ( (num < 0) || (num >= MXMAPIDS) ) num = 0; 55 return (MapIds[num]) ; 56 } 57 58 string PIColorMap::GetStandardColorMapName(int num) 59 { 60 if ( (num < 0) || (num >= MXMAPIDS) ) num = 0; 61 return (MapNoms[num]) ; 62 } 63 39 64 40 65 //++ … … 77 102 78 103 if (NMaxTableAuto == 0) { // Il faut allouer les tables de depart 79 if ( TotNbColors() > 2048) NMaxTableAuto = MXMAPIDS-1;104 if ( TotNbColors() > 4096 ) NMaxTableAuto = MXMAPIDS-1; 80 105 else NMaxTableAuto = 3; 81 for(k=0; k<NMaxTableAuto; k++) { 106 // for(k=0; k<NMaxTableAuto; k++) { 107 for(k=0; k<3; k++) { // On alloue les 3 tables de depart 82 108 mnom = MapNoms[k]; 109 cout << " PIColorMap::PIColorMap(CMapId id) Allocating ColorMap " 110 << mnom << " ... " << endl; 83 111 mMaps[k] = new PIColorMap(MapIds[k], MapNCols[k], mnom); 84 112 } … … 88 116 for(kdx=0; kdx<MXMAPIDS; kdx++) if (id == MapIds[kdx]) break; 89 117 if (kdx == MXMAPIDS) { id = MapIds[0]; kdx = 0; } 90 for(k=0; k<NMaxTableAuto; k++) 91 if (id == mMaps[k]->Type()) { 118 for(k=0; k<NMaxTableAuto; k++) { 119 if ((MapIds[k] == id) && (mMaps[k] == NULL)) { // Table pas encore alloue 120 mnom = MapNoms[k]; 121 cout << " PIColorMap::PIColorMap(CMapId id) Allocating ColorMap " 122 << mnom << " ... " << endl; 123 mMaps[k] = new PIColorMap(MapIds[k], MapNCols[k], mnom); 124 } 125 if (mMaps[k] && (id == mMaps[k]->Type()) ) { 92 126 CopyFrom(mMaps[k]); 93 127 mCTId = mMaps[k]->mCTId; mColTNums[mCTId]++; 94 128 break; 95 129 } 130 } 96 131 if (Type() != id) { // Table pas encore trouve dans la liste 97 132 k = NMaxTableAuto; … … 353 388 break; 354 389 390 case CMAP_MIDAS_Pastel : // Les valeurs correspondent a je ne sais quel table MIDAS 391 case CMAP_MIDAS_Heat : // A faire pour CMAP_MIDAS_Pastel CMAP_MIDAS_Heat 392 case CMAP_MIDAS_Rainbow3 : // A faire pour Heat Rainbow3 BlueRed BlueWhite 393 case CMAP_MIDAS_BlueRed : // BlueRed -> idl11 394 case CMAP_MIDAS_BlueWhite : // BlueWhite -> blulut.lutlis 395 { 396 static float rgb_r[256] = { 397 0, 0, 0.01961, 0.0549, 0.08627, 0.1098, 0.13725, 0.15686, 0.18039, 0.2, 398 0.21569, 0.23529, 0.25098, 0.26275, 0.28235, 0.29412, 0.30588, 0.31765, 399 0.33333, 0.34118, 0.35294, 0.36078, 0.37255, 0.38431, 0.39216, 0.4, 400 0.41176, 0.41961, 0.43137, 0.43529, 0.44314, 0.45098, 0.45882, 0.46667, 401 0.47059, 0.48235, 0.48627, 0.49412, 0.50196, 0.50588, 0.5098, 0.51765, 402 0.52157, 0.53333, 0.53725, 0.54118, 0.54902, 0.55294, 0.55686, 0.56078, 403 0.56471, 0.57255, 0.58039, 0.58431, 0.58824, 0.59216, 0.59608, 0.6, 0.60392, 404 0.60784, 0.61176, 0.61569, 0.61961, 0.62745, 0.63137, 0.63529, 0.63922, 405 0.64314, 0.64706, 0.65098, 0.6549, 0.6549, 0.65882, 0.66275, 0.66667 , 406 0.67059, 0.67843, 0.67843, 0.68235, 0.68627, 0.6902, 0.6902, 0.69412, 407 0.69804, 0.70196, 0.70196, 0.70588, 0.7098, 0.71373, 0.71373, 0.71765, 408 0.72157, 0.72157, 0.72941, 0.73333, 0.73333, 0.73725, 0.74118, 0.74118, 409 0.7451, 0.7451, 0.74902, 0.75294, 0.75294, 0.75686, 0.76078, 0.76078, 410 0.76471, 0.76471, 0.76863, 0.76863, 0.77255, 0.78039, 0.78039, 0.78431, 411 0.78431, 0.78824, 0.78824, 0.79216, 0.79216, 0.79608, 0.79608, 0.8, 0.8, 412 0.80392, 0.80392, 0.80784, 0.80784, 0.81176, 0.81176, 0.81569, 0.81569, 413 0.81961, 0.81961, 0.82745, 0.82745, 0.83137, 0.83137, 0.83529, 0.83529, 414 0.83922, 0.83922, 0.83922, 0.84314, 0.84314, 0.84706, 0.84706, 0.85098, 415 0.85098, 0.8549, 0.8549, 0.8549, 0.85882, 0.85882, 0.86275, 0.86275, 416 0.86275, 0.86667, 0.86667, 0.87059, 0.87059, 0.87059, 0.87843, 0.87843, 417 0.88235, 0.88235, 0.88235, 0.88627, 0.88627, 0.8902, 0.8902, 0.8902, 0.89412, 418 0.89412, 0.89412, 0.89804, 0.89804, 0.89804, 0.90196, 0.90196, 0.90588, 419 0.90588, 0.90588, 0.9098, 0.9098, 0.9098, 0.91373, 0.91373, 0.91373, 420 0.91765, 0.91765, 0.91765, 0.92157, 0.92157, 0.92157, 0.92941, 0.92941, 421 0.92941, 0.93333, 0.93333, 0.93333, 0.93725, 0.93725, 0.93725, 0.94118, 422 0.94118, 0.94118, 0.94118, 0.9451, 0.9451, 0.9451, 0.94902, 0.94902, 423 0.94902, 0.95294, 0.95294, 0.95294, 0.95686, 0.95686, 0.95686, 0.95686, 424 0.96078, 0.96078, 0.96078, 0.96471, 0.96471, 0.96471, 0.96471, 0.96863, 425 0.96863, 0.96863, 0.97255, 0.97255, 0.97255, 0.97255, 0.98039, 0.98039, 426 0.98039, 0.98039, 0.98431, 0.98431, 0.98431, 0.98824, 0.98824, 0.98824, 427 0.98824, 0.99216, 0.99216, 0.99216, 0.99216, 0.99608, 0.99608, 0.99608, 428 0.99608, 1, 1 }; 429 static float rgb_g[256] = { 430 0, 0, 0, 0, 0.00392, 0.00392, 0.00392, 0.00392, 0.00392, 0.00784, 431 0.00784, 0.00784, 0.00784, 0.01176, 0.01176, 0.01176, 0.01176, 0.01176, 432 0.01569, 0.01569, 0.01569, 0.01569, 0.01961, 0.01961, 0.01961, 0.01961, 433 0.02353, 0.02353, 0.02353, 0.02745, 0.02745, 0.02745, 0.02745, 0.03137, 434 0.03137, 0.03137, 0.03529, 0.03529, 0.03529, 0.03529, 0.04314, 0.04314, 435 0.04314, 0.04706, 0.04706, 0.04706, 0.05098, 0.05098, 0.05098, 0.0549, 436 0.0549, 0.0549, 0.05882, 0.05882, 0.05882, 0.06275, 0.06275, 0.06275, 0.06667, 437 0.06667, 0.06667, 0.07059, 0.07059, 0.07451, 0.07451, 0.07451, 0.07843, 438 0.07843, 0.08235, 0.08235, 0.08235, 0.08627, 0.08627, 0.0902, 0.0902, 439 0.0902, 0.09412, 0.09412, 0.09804, 0.09804, 0.10196, 0.10196, 0.10588, 440 0.10588, 0.1098, 0.1098, 0.1098, 0.11765, 0.11765, 0.12157, 0.12157, 441 0.12549, 0.12549, 0.12941, 0.12941, 0.13333, 0.13725, 0.13725, 0.14118, 442 0.14118, 0.1451, 0.1451, 0.14902, 0.14902, 0.15294, 0.15686, 0.15686, 443 0.16078, 0.16078, 0.16471, 0.16863, 0.16863, 0.17255, 0.17255, 0.17647, 444 0.18039, 0.18039, 0.18431, 0.18824, 0.18824, 0.19608, 0.2, 0.2, 0.20392, 445 0.20784, 0.20784, 0.21176, 0.21569, 0.21961, 0.21961, 0.22353, 0.22745, 446 0.23137, 0.23137, 0.23529, 0.23922, 0.24314, 0.24314, 0.24706, 0.25098, 447 0.2549, 0.25882, 0.26275, 0.26275, 0.27059, 0.27451, 0.27843, 0.28235, 448 0.28627, 0.2902, 0.29412, 0.29804, 0.29804, 0.30196, 0.30588, 0.3098, 449 0.31373, 0.31765, 0.32157, 0.32549, 0.33333, 0.33725, 0.34118, 0.3451, 450 0.34902, 0.35294, 0.35686, 0.36078, 0.36471, 0.37255, 0.37647, 0.38039, 451 0.38431, 0.38824, 0.39216, 0.4, 0.40392, 0.40784, 0.41176, 0.41961, 0.42353, 452 0.42745, 0.43529, 0.43922, 0.44314, 0.45098, 0.4549, 0.45882, 0.46667, 453 0.47059, 0.47843, 0.48235, 0.4902, 0.49412, 0.50196, 0.50588, 0.51373, 454 0.51765, 0.52549, 0.52941, 0.53725, 0.54118, 0.54902, 0.55686, 0.56078, 455 0.56863, 0.57647, 0.58039, 0.58824, 0.59608, 0.6, 0.60784, 0.61569, 456 0.62353, 0.63137, 0.63529, 0.64314, 0.65098, 0.65882, 0.66667, 0.67451, 457 0.68235, 0.6902, 0.69804, 0.70588, 0.71373, 0.72157, 0.72941, 0.73725, 0.7451, 458 0.75294, 0.76078, 0.77255, 0.78039, 0.78824, 0.79608, 0.80392, 0.81569, 459 0.82353, 0.83137, 0.84314, 0.85098, 0.86275, 0.87059, 0.87843, 0.8902 , 460 0.89804, 0.9098, 0.91765, 0.92941, 0.94118, 0.94902, 0.96078, 0.97255, 461 0.98039, 0.99216 }; 462 static float rgb_b[256] = { 463 0, 0, 0, 0, 0.00392, 0.00392, 0.00392, 0.00392, 0.00392, 0.00784, 464 0.00784, 0.00784, 0.00784, 0.01176, 0.01176, 0.01176, 0.01176, 0.01176, 465 0.01569, 0.01569, 0.01569, 0.01569, 0.01961, 0.01961, 0.01961, 0.01961, 466 0.02353, 0.02353, 0.02353, 0.02745, 0.02745, 0.02745, 0.02745, 0.03137, 467 0.03137, 0.03137, 0.03529, 0.03529, 0.03529, 0.03529, 0.04314, 0.04314, 468 0.04314, 0.04706, 0.04706, 0.04706, 0.05098, 0.05098, 0.05098, 0.0549, 469 0.0549, 0.0549, 0.05882, 0.05882, 0.05882, 0.06275, 0.06275, 0.06275, 0.06667, 470 0.06667, 0.06667, 0.07059, 0.07059, 0.07451, 0.07451, 0.07451, 0.07843, 471 0.07843, 0.08235, 0.08235, 0.08235, 0.08627, 0.08627, 0.0902, 0.0902, 472 0.0902, 0.09412, 0.09412, 0.09804, 0.09804, 0.10196, 0.10196, 0.10588, 473 0.10588, 0.1098, 0.1098, 0.1098, 0.11765, 0.11765, 0.12157, 0.12157, 474 0.12549, 0.12549, 0.12941, 0.12941, 0.13333, 0.13725, 0.13725, 0.14118, 475 0.14118, 0.1451, 0.1451, 0.14902, 0.14902, 0.15294, 0.15686, 0.15686, 476 0.16078, 0.16078, 0.16471, 0.16863, 0.16863, 0.17255, 0.17255, 0.17647, 477 0.18039, 0.18039, 0.18431, 0.18824, 0.18824, 0.19608, 0.2, 0.2, 0.20392, 478 0.20784, 0.20784, 0.21176, 0.21569, 0.21961, 0.21961, 0.22353, 0.22745, 479 0.23137, 0.23137, 0.23529, 0.23922, 0.24314, 0.24314, 0.24706, 0.25098, 480 0.2549, 0.25882, 0.26275, 0.26275, 0.27059, 0.27451, 0.27843, 0.28235, 481 0.28627, 0.2902, 0.29412, 0.29804, 0.29804, 0.30196, 0.30588, 0.3098, 482 0.31373, 0.31765, 0.32157, 0.32549, 0.33333, 0.33725, 0.34118, 0.3451, 483 0.34902, 0.35294, 0.35686, 0.36078, 0.36471, 0.37255, 0.37647, 0.38039, 484 0.38431, 0.38824, 0.39216, 0.4, 0.40392, 0.40784, 0.41176, 0.41961, 0.42353, 485 0.42745, 0.43529, 0.43922, 0.44314, 0.45098, 0.4549, 0.45882, 0.46667, 486 0.47059, 0.47843, 0.48235, 0.4902, 0.49412, 0.50196, 0.50588, 0.51373, 487 0.51765, 0.52549, 0.52941, 0.53725, 0.54118, 0.54902, 0.55686, 0.56078, 488 0.56863, 0.57647, 0.58039, 0.58824, 0.59608, 0.6, 0.60784, 0.61569, 0.62353, 489 0.63137, 0.63529, 0.64314, 0.65098, 0.65882, 0.66667, 0.67451, 0.68235, 490 0.6902, 0.69804, 0.70588, 0.71373, 0.72157, 0.72941, 0.73725, 0.7451, 491 0.75294, 0.76078, 0.77255, 0.78039, 0.78824, 0.79608, 0.80392, 0.81569, 492 0.82353, 0.83137, 0.84314, 0.85098, 0.86275, 0.87059, 0.87843, 0.8902, 493 0.89804, 0.9098, 0.91765, 0.92941, 0.94118, 0.94902, 0.96078, 0.97255, 494 0.98039, 0.99216 }; 495 for(i=0; i<mNCol; i++) { 496 mycol.red = (rgb_r[i]*65535.); 497 mycol.green = (rgb_g[i]*65535.); 498 mycol.blue = (rgb_b[i]*65535.); 499 AllocColor(mycol, i); 500 } 501 } 502 break; 503 355 504 default : 356 505 for(i=0; i<mNCol; i++) { -
trunk/SophyaPI/PI/picmap.h
r190 r1122 22 22 CMAP_COLRJ128 = 8, // 128 couleurs du rouge au jaune/blanc 23 23 CMAP_COLBR128 = 9, // 128 couleurs du bleu au rouge 24 CMAP_COL16 = 10 // 16 Couleurs Arcenciel 24 CMAP_COL16 = 10, // 16 Couleurs Arcenciel 25 26 // Tables de couleur importees de MIDAS 27 CMAP_MIDAS_Pastel = 101, // Bleu-Violet-Rouge-Jaune 28 CMAP_MIDAS_Heat = 102, // Noir-Rouge-Orange-Blanc 29 CMAP_MIDAS_Rainbow3 = 103, // Noir-Bleu-Vert-Jaune-Rouge-Violet-Blanc 30 CMAP_MIDAS_BlueRed = 104, // Bleu-Violet-Rouge 31 CMAP_MIDAS_BlueWhite = 105 // Noir-Bleu-Blanc 25 32 }; 26 33 … … 34 41 35 42 static void CleanColorMaps(); 43 static int NumberStandardColorMaps(); 44 static CMapId GetStandardColorMapId(int num); 45 static string GetStandardColorMapName(int num); 36 46 37 47 protected: -
trunk/SophyaPI/PI/piimgtools.cc
r684 r1122 149 149 cpy = offy; 150 150 mOptzc[0] = new PIOptMenu(this, "imglut-opt-3", bsx*1.75, bsy, cpx, cpy); 151 mOptzc[0]->AppendItem("Grey32", 201);152 mOptzc[0]->AppendItem("GreyInv32", 202); 153 mOptzc[0]->AppendItem("ColRJ32", 203); 154 mOptzc[0]->AppendItem("ColBR32", 204);155 mOptzc[0]->AppendItem("ColRV32", 205); 156 m Optzc[0]->AppendItem("Grey128", 206);157 mOptzc[0]->AppendItem("GreyInv128", 207); 158 mOptzc[0]->AppendItem("ColRJ128", 208);159 mOptzc[0]-> AppendItem("ColBR128", 209);160 mOptzc[0]->AppendItem("Col16", 210); 151 int kcc; 152 // D'abord les tables standard de PI 153 for(kcc=0; kcc<10; kcc++) 154 mOptzc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 155 // Les tables ramenees de MIDAS 156 mCaszc[0] = new PIMenu(mOptzc[0]->Menu(), "MIDAS-CMap"); 157 for(kcc=10; kcc<PIColorMap::NumberStandardColorMaps(); kcc++) 158 mCaszc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 159 mOptzc[0]->Menu()->AppendPDMenu(mCaszc[0]); 160 161 161 mOptzc[0]->SetValue(203); 162 162 mOptzc[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); … … 267 267 delete mOptzc[i]; 268 268 } 269 delete mCaszc[0]; 269 270 for(i=0; i<5; i++) delete mButsz[i]; 270 271 for(i=0; i<3; i++) delete mButcax[i]; … … 432 433 433 434 434 CMapId cmap[10] = { CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32,435 CMAP_COLBR32, CMAP_COLRV32, CMAP_GREY128,436 CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128,437 CMAP_COL16 };438 439 435 if ((msg <= 110) && (msg >= 90)) // Zoom 440 436 PIImage::CurrentPIImage()->SetZoom((int)(msg-100), true); 441 else if ((msg > 200) && (msg < 2 11)) // Changement de couleur442 PIImage::CurrentPIImage()->SetColMapId( cmap[msg-201], true);437 else if ((msg > 200) && (msg < 299)) // Changement de couleur 438 PIImage::CurrentPIImage()->SetColMapId(PIColorMap::GetStandardColorMapId(msg-201), true); 443 439 444 440 // Cuts -
trunk/SophyaPI/PI/piimgtools.h
r557 r1122 38 38 // Pour la couleur et le zoom 39 39 PIOptMenu* mOptzc[2]; 40 PIMenu* mCaszc[2]; 40 41 // Pour expand et compress 41 42 PIButton* mButsz[5]; -
trunk/SophyaPI/PI/pioptmenux.cc
r367 r1122 83 83 { 84 84 // printf("PIOptMenuX::Process Msg= %d Sender= %lx \n", (int)msg, (long)sender); 85 if (sender == mMen) { 85 // if (sender == mMen) { Ca peut venir d'un cascade menu !! 86 86 SetValue(UserMsg(msg)); 87 87 ReSend(msg, this, NULL); 88 }88 //} 89 89 return; 90 90 } … … 114 114 int n; 115 115 Arg warg[2]; 116 116 117 n=mMen->GetNumItemMsg(msg); 117 118 if (n < 0) return;
Note:
See TracChangeset
for help on using the changeset viewer.