Changeset 3550 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Dec 13, 2008, 5:58:40 PM (17 years ago)
Author:
ansari
Message:

Ajout commandes win2rgb et wdg2rgb d'export au format PI-RGB de fenetre/widget ds PIAGraphicExecutor.cc , Reza 13/12/2008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/graphexecut.cc

    r3546 r3550  
    329329  P2DPixRGBAdapter * argbimg = new P2DPixRGBAdapter(rgbimg, true);
    330330  mImgApp->DispImage(argbimg, tokens[0], gropt);
     331}
     332else if ((kw == "win2rgb")||(kw == "wdg2rgb")) {
     333  if (tokens.size() < 1) {
     334    cout << "Usage: win2rgb/wdg2rgb PI-RGB_FileName" << endl;
     335    return(0);
     336  }
     337  PIWdg* wdg=NULL;
     338  if (kw=="win2rgb")  wdg=(PIWdg*)mImgApp->CurrentBaseWdg();
     339  else wdg=(PIWdg*) mImgApp->CurrentWindow();
     340  if (wdg==NULL) return 1;
     341  PIPixRGBArray rgba(10,10);
     342  mImgApp->CkEvt_LockMutex();
     343  wdg->ExportToRGB(rgba);
     344  mImgApp->UnlockMutex();
     345  if (kw=="win2rgb")
     346    cout << " Exporting current window to PI-RGB-file " << tokens[0] << endl;
     347  else cout << " Exporting current widget to PI-RGB-file " << tokens[0] << endl;
     348  rgba.SaveToFile(tokens[0].c_str());
    331349}
    332350// Obsolete : ne pas virer SVP, cmv 26/7/99
     
    766784usage = "Read and display RGB-image object (PIPixRGBArray) from file ";
    767785usage += "\n Usage : pirgbdisp PI-RGB_FileName [gr_opt] ";
     786usage += "\n gr_opt (def=rgb216cm):zoom, rgb4096cm rgb32768cm lut=rgb[,min,max]";
     787usage += "\n Related commands: win2rgb wdg2rgb "; 
     788mpiac->RegisterCommand(kw, usage, this, grp);
     789kw = "win2rgb";
     790usage = " Export the current window to a PI-RGB file (.rgb)";
     791usage += "\n Usage : win2rgb PI-RGB_FileName  (.rgb)";
     792usage += "\n Related commands: pirgbdisp  wdg2rgb "; 
     793mpiac->RegisterCommand(kw, usage, this, grp);
     794kw = "wdg2rgb";
     795usage = " Export the current widget to a PI-RGB file (.rgb)";
     796usage += "\n Usage : wdg2rgb PI-RGB_FileName  (.rgb)";
     797usage += "\n Related commands: pirgbdisp  win2rgb "; 
    768798mpiac->RegisterCommand(kw, usage, this, grp);
    769799
Note: See TracChangeset for help on using the changeset viewer.