Changeset 10 in Sophya
- Timestamp:
- Mar 8, 1996, 8:02:56 PM (30 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pibwdgx.cc
r9 r10 17 17 #define NMAXFONTSZ 5 18 18 static XFontStruct * fntst[NMAXFONTSZ][3]; 19 static int fntsz[NMAXFONTSZ] = { 7,10,12,14,16};19 static int fntsz[NMAXFONTSZ] = {8,10,12,14,16}; 20 20 static PIFontAtt fntatt[3] = { PI_RomanFont, PI_BoldFont, PI_ItalicFont }; 21 21 #define NMAXCOL 10 -
trunk/SophyaPI/PI/pidemo.cc
r9 r10 257 257 if ( CurrentPIImage()) 258 258 { 259 CurrentPIImage()->SetZoom(1 );260 CurrentPIImage()->SetOffset(0, 0 );259 CurrentPIImage()->SetZoom(1, false); 260 CurrentPIImage()->SetOffset(0, 0, false); 261 261 CurrentImgWin()->SetSize(CurrentImage()->XSize(), 262 262 CurrentImage()->YSize()); … … 267 267 if ( CurrentPIImage()) 268 268 { 269 CurrentPIImage()->SetZoom(2 );270 CurrentPIImage()->SetOffset(0, 0 );269 CurrentPIImage()->SetZoom(2, false); 270 CurrentPIImage()->SetOffset(0, 0, false); 271 271 CurrentImgWin()->SetSize(CurrentImage()->XSize()*2, 272 272 CurrentImage()->YSize()*2); … … 277 277 if ( CurrentPIImage()) 278 278 { 279 CurrentPIImage()->SetZoom(-2 );280 CurrentPIImage()->SetOffset(0, 0 );279 CurrentPIImage()->SetZoom(-2, false); 280 CurrentPIImage()->SetOffset(0, 0, false); 281 281 CurrentImgWin()->SetSize(CurrentImage()->XSize()/2, 282 282 CurrentImage()->YSize()/2); … … 287 287 if ( CurrentPIImage()) 288 288 { 289 CurrentPIImage()->SetZoom(4 );290 CurrentPIImage()->SetOffset(0, 0 );289 CurrentPIImage()->SetZoom(4, false); 290 CurrentPIImage()->SetOffset(0, 0, false); 291 291 CurrentImgWin()->SetSize(CurrentImage()->XSize()*4, 292 292 CurrentImage()->YSize()*4); … … 297 297 if ( CurrentPIImage()) 298 298 { 299 CurrentPIImage()->SetZoom(-4 );299 CurrentPIImage()->SetZoom(-4, false); 300 300 CurrentPIImage()->SetOffset(0, 0); 301 301 CurrentImgWin()->SetSize(CurrentImage()->XSize()/4, -
trunk/SophyaPI/PI/piimage.cc
r9 r10 49 49 50 50 /* --Methode-- */ 51 void PIImage::SetImage(RzImage *pim )51 void PIImage::SetImage(RzImage *pim, bool refr) 52 52 { 53 53 … … 57 57 if (img) 58 58 { 59 SetSize(img->XSize(), img->YSize());59 // SetSize(img->XSize(), img->YSize()); 60 60 SetPave(); 61 61 if (img->minPix>img->maxPix) img->CheckDyn(); 62 SetLut(img->minPix, img->maxPix, kLutType_Lin, 1); 63 } 64 //printf("Debug_SetImage: %ld %ld \n", (long)img, (long)lut); 65 return; 66 } 67 68 69 /* --Methode-- */ 70 void PIImage::SetZoomWin(PIPixmap * zw) 62 SetLut(img->minPix, img->maxPix, kLutType_Lin, 1, refr); 63 } 64 return; 65 } 66 67 68 /* --Methode-- */ 69 void PIImage::SetZoomWin(PIPixmap * zw, bool refr) 71 70 { 72 71 zow = zw; 73 if (zow) zow->SetColMap(GetColMapId()); 74 } 75 76 77 78 /* --Methode-- */ 79 void PIImage::SetLut(float min, float max, int typlut, int lauto) 72 if (zow && refr && img) 73 { 74 zow->SetColMap(GetColMapId(), false); 75 ComputeZoomPixmap(); 76 } 77 return; 78 } 79 80 81 82 /* --Methode-- */ 83 void PIImage::SetLut(float min, float max, int typlut, int lauto, bool refr) 80 84 { 81 85 if (lut) delete(lut); … … 99 103 lut = new LUT(min, max, NbCol(), typlut); 100 104 101 Apply();102 return; 103 } 104 105 106 /* --Methode-- */ 107 void PIImage::SetLut(LUT *clut )105 if (refr) Apply(); 106 return; 107 } 108 109 110 /* --Methode-- */ 111 void PIImage::SetLut(LUT *clut, bool refr) 108 112 { 109 113 LUT * olut = lut; … … 111 115 if (olut) delete olut; 112 116 113 Apply();114 return; 115 } 116 117 118 /* --Methode-- */ 119 void PIImage::SetZoom(int zm )117 if (refr) Apply(); 118 return; 119 } 120 121 122 /* --Methode-- */ 123 void PIImage::SetZoom(int zm, bool refr) 120 124 { 121 125 if ((zm == 0) || (zm == -1) ) zoom = 1; … … 124 128 else zoom = zm; 125 129 SetOffset(); 126 Apply();127 return; 128 } 129 130 /* --Methode-- */ 131 void PIImage::SetOffset(int ox, int oy )130 if (refr) Apply(); 131 return; 132 } 133 134 /* --Methode-- */ 135 void PIImage::SetOffset(int ox, int oy, bool refr) 132 136 { 133 137 if (img == NULL) {offx = offy = 0; return; } … … 137 141 if (oy >= (img->YSize()-1)) oy = img->YSize()-2; 138 142 offx = ox; offy = oy; 139 return; 140 } 141 142 /* --Methode-- */ 143 void PIImage::SetColMap(CMapId cmap) 144 { 145 PIPixmap::SetColMap(cmap); 146 if (zow) zow->SetColMap(cmap); 143 if (refr) Apply(); 144 return; 145 } 146 147 /* --Methode-- */ 148 void PIImage::SetColMap(CMapId cmap, bool refr) 149 { 150 PIPixmap::SetColMap(cmap, refr); 151 if (zow) zow->SetColMap(cmap, refr); 147 152 return; 148 153 } … … 155 160 if (zow != NULL) 156 161 { 157 zow->SetColMap(GetColMapId() );162 zow->SetColMap(GetColMapId(), false); 158 163 ComputeZoomPixmap(); 159 164 } -
trunk/SophyaPI/PI/piimage.h
r8 r10 41 41 ~PIImage(); 42 42 43 void SetImage(RzImage *pim );44 void SetZoomWin(PIPixmap * zw );43 void SetImage(RzImage *pim, bool refr=true); 44 void SetZoomWin(PIPixmap * zw, bool refr=true); 45 45 inline void SetTextWin(PILabel * tw) { txw = tw; }; 46 46 47 void SetLut(float min, float max, 48 int typlut=kLutType_Lin, int lauto=0); 49 void SetLut(LUT *clut); 50 void SetZoom(int zm); 47 void SetLut(float min, float max, int typlut=kLutType_Lin, 48 int lauto=0, bool refr=true); 49 void SetLut(LUT *clut, bool refr=true); 51 50 52 void SetOffset(int ox, int oy); 51 void SetZoom(int zm, bool refr=true); 52 void SetOffset(int ox, int oy, bool refr=true); 53 53 54 virtual void SetColMap(CMapId cmap );54 virtual void SetColMap(CMapId cmap, bool refr=true); 55 55 56 56 inline RzImage * Image() { return(img); } -
trunk/SophyaPI/PI/pipixmapgen.cc
r6 r10 29 29 30 30 /* --Methode-- */ 31 void PIPixmapGen::SetPixmap(unsigned char *pix, int sx, int sy )31 void PIPixmapGen::SetPixmap(unsigned char *pix, int sx, int sy, bool refr) 32 32 { 33 33 pixmap = pix; nx = sx; ny = sy; 34 Refresh();34 if (refr) Refresh(); 35 35 } 36 36 37 37 38 38 /* --Methode-- */ 39 void PIPixmapGen::SetColMap(CMapId cmapid )39 void PIPixmapGen::SetColMap(CMapId cmapid, bool refr) 40 40 { 41 42 43 Refresh();41 if (cmap) delete cmap; 42 cmap = new PIColorMap(cmapid); 43 if (refr) Refresh(); 44 44 } 45 45 -
trunk/SophyaPI/PI/pipixmapgen.h
r2 r10 20 20 virtual long kind() {return ClassId; } 21 21 22 virtual void SetPixmap(unsigned char *pix, int sx, int sy );23 void SetColMap(CMapId cmapid );22 virtual void SetPixmap(unsigned char *pix, int sx, int sy, bool refr=true); 23 void SetColMap(CMapId cmapid, bool refr=true); 24 24 inline CMapId GetColMapId() { return (cmap->Type()); }; 25 25 inline int NbCol() { return(cmap->NCol()); };
Note:
See TracChangeset
for help on using the changeset viewer.